In facebook tutorials I see this sample code:
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
facebook.authorizeCallback(requestCode, resultCode, data);
}
Using this code I receive:
onAuthFail with error= “Action canceled”.
Removing
super.onActivityResult(requestCode, resultCode, data);
It works fine.
So my question is: Where to put super.onActivityResult(requestCode, resultCode, data)?
Before facebook callback, after or delete it. At moment without calling super.onActivityResult – code works fine. Can missing cause problems?
UPDATE:
I’m using this in manifest:
<activity android:launchMode="singleInstance" android:name=".profile.LoginForm"
android:screenOrientation=”portrait” android:noHistory=”true”>
Can this produce problem?
UPDATE2:
Reason to put ‘singleInstance’ in manifest is: to avoid relaunching of my login form. This problem forced to current problem.
Regarding your update:
does indeed cause problems with
startActivityForResult()andonActivityResult(). See the launchMode documentation:Which means that the started facebook auth activity is not part of your current task and therefore can’t deliver any result(s). If you debug this, you should notice that
onActivityResult()gets called immediately after the sub-activity has been started (which is way too early to have a correct/useful result).I’d say change your launchMode to something different (also not to
singleTask, it has the same issue).I’m not sure how the superclass method affects this though, since you claim this fixed it. In theory this should never work with
singleInstance.