title: NullPointerException on ContextWrapper.getPackageName in BackupManager.dataChanged
body: <p>Hello i try to use android cloud backup tools.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>public class TheBackupAgent extends BackupAgentHelper {
     // The name of the SharedPreferences file
     static final String DATABASE = "/data/data/com.tigo/databases/exercise";
  
     // A key to uniquely identify the set of backup data
     public Context mContext;
  
     String FILES_BACKUP_KEY;
  
     // Allocate a helper and add it to the backup agent
     @Override
  public void onCreate() {
  
      FILES_BACKUP_KEY = Secure.getString(TheBackupAgent.this.getContentResolver(),Secure.ANDROID_ID);
  
      Log.i("created", "created");
  
      FileBackupHelper helper = new FileBackupHelper(TheBackupAgent.this, DATABASE);
      addHelper(FILES_BACKUP_KEY, helper);
  
     }
  
     public void requestBackup() {
         BackupManager bm = new BackupManager(TheBackupAgent.this);
         bm.dataChanged();
       }
  
     public void setContext(Context context)
     {
         mContext = context;
     }
  
     public void requestRestore() 
     {
         BackupManager bm = new BackupManager(TheBackupAgent.this);
         bm.requestRestore(
                 new RestoreObserver() 
                 {
                     public void restoreStarting(int error) 
                     {
                         System.out.println(error);
                     }
  
                     public void restoreFinished(int error) 
                     {
  
                         System.out.println(error);
                     }
  
  
                 }
         );
  
  
       }
  </code></pre>
  
  <p>In my manifest i have this:</p>
  
  <pre><code>&lt;application
          android:name="com.example.workoutlog.ErrorReport"
          android:allowBackup="true"
          android:backupAgent="com.example.workoutlog.TheBackupAgent"
          android:icon="@drawable/logo_for_stroe"
          android:label="@string/app_name"
          android:theme="@style/Holo.Theme.Light.DarkActionBar" 
          &gt;
  </code></pre>
  
  <p>and this </p>
  
  <pre><code> &lt;meta-data android:name="com.google.android.backup.api_key" android:value="********************************" /&gt;
  </code></pre>
  
  <p>When i try to use <code>bm.dataChanged()</code></p>
  
  <p>I get this error:</p>
  
  <pre><code>java.lang.NullPointerException
          at android.content.ContextWrapper.getPackageName(ContextWrapper.java:135)
          at android.app.backup.BackupManager.dataChanged(BackupManager.java:93)
          at com.example.workoutlog.TheBackupAgent.requestBackup(TheBackupAgent.java:42)
          at com.example.workoutlog.Settings$9.onClick(Settings.java:1231)
          at org.holoeverywhere.internal.AlertController$ButtonHandler.handleMessage(AlertController.java:280)
          at android.os.Handler.dispatchMessage(Handler.java:99)
          at android.os.Looper.loop(Looper.java:137)
          at android.app.ActivityThread.main(ActivityThread.java:5227)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:511)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
          at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>Thanks for helping</p>