title: Facebook login - cannot call LoginActivity with null calling package
body: <p>I have an activity A that has no specified launchMode and that uses the Facebook SDK to login.</p>
  
  <p>Activity A starts activity B, which is launch mode singleTop.</p>
  
  <p>Somehow, I'm running into this error periodically on resume, in rather rare circumstances.</p>
  
  <p>Any thoughts on what this could be? I'm not entirely understanding how I could be hitting this if I'm not making any Facebook SDK calls from any activity that has a launch mode specified. All the other stuff I've run down on this error involves a pretty straightforward interpretation of this error text, which this doesn't seem to be.</p>
  
  <p>This only happens onResume. To be extra clear, in the normal course of the activity, everything works just fine, the facebook login window launches fine, etc.</p>
  
  <p>In my manifest I do have:</p>
  
  <pre><code>&lt;activity android:name="com.facebook.LoginActivity"/&gt;
  </code></pre>
  
  <p>and the launching activity as</p>
  
  <pre><code>&lt;activity android:name="mypackage.login.SocialLoginActivity" android:screenOrientation="portrait"&gt;
  </code></pre>
  
  <p>The error text:</p>
  
  <pre><code>java.lang.RuntimeException: Unable to resume activity {mypackage/com.facebook.LoginActivity}: com.facebook.FacebookException: Cannot call LoginActivity with a null calling package. This can occur if the launchMode of the caller is singleInstance.
         at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2639)
         at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2667)
         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2140)
         at android.app.ActivityThread.access$700(ActivityThread.java:140)
         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
         at android.os.Handler.dispatchMessage(Handler.java:99)
         at android.os.Looper.loop(Looper.java:137)
         at android.app.ActivityThread.main(ActivityThread.java:4921)
         at java.lang.reflect.Method.invokeNative(Method.java)
         at java.lang.reflect.Method.invoke(Method.java:511)
         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
         at dalvik.system.NativeStart.main(NativeStart.java)
  Caused by: com.facebook.FacebookException: Cannot call LoginActivity with a null calling package. This can occur if the launchMode of the caller is singleInstance.
         at com.facebook.LoginActivity.onResume(LoginActivity.java:111)
         at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1199)
         at android.app.Activity.performResume(Activity.java:5280)
         at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2629)
         at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2667)
         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2140)
         at android.app.ActivityThread.access$700(ActivityThread.java:140)
         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
         at android.os.Handler.dispatchMessage(Handler.java:99)
         at android.os.Looper.loop(Looper.java:137)
         at android.app.ActivityThread.main(ActivityThread.java:4921)
         at java.lang.reflect.Method.invokeNative(Method.java)
         at java.lang.reflect.Method.invoke(Method.java:511)
         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
         at dalvik.system.NativeStart.main(NativeStart.java)
  </code></pre>