I have developed an android application with TabGroupActivity (See this for example) and everything works fine except Social Networking integration like Facebook and Twitter.
This Error was recorded in Stackoverflow before here and here and here
java.lang.RuntimeException: Unable to resume activity {com.xxxx.xxxxx/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.
07-29 18:22:55.757: E/AndroidRuntime(2342): Caused by: com.facebook.FacebookException: Cannot call LoginActivity with a null calling package. This can occur if the launchMode of the caller is singleInstance.
P.S:Everything worked fine before implementing TabGroupActivity
UPDATE 1: In the Manifest file i updated the code as follows as:
<activity
android:name="com.facebook.LoginActivity"
android:label="@string/com_facebook_loginview_log_in_button"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:launchMode="singleTask" />
But the Exception still gives: the launchMode of the caller is singleInstance
Why So..??
UPDATE 2: Now I kept debugging points inside LoginActivity of Facebook SDK. In that for getCallingPackage(), I get Null
String callingPackage = getCallingPackage();//Always Null
BackTracing it: On the Calling Activity (FacebookShare.java), I always get data as null instead of some values.
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data);
//Toast.makeText(FacebookShareActivity.this, "onActivityResult", Toast.LENGTH_SHORT).show();
}
Can anyone explain this behavior..?? I have been stuck on this from days.