Android Facebook SDK - problem with authorizeCallback ()

I have an Android app that, among other things, also publishes updates on Facebook.

I created my code according to this example and it works great. The only difference between my code and what is indicated in the link above is that I also expanded onActivityResult, as indicated on the official Facebook SDK for Android website.

    @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    facebookClient.authorizeCallback(requestCode, resultCode, data);
}

Sometimes, however, I get a null pointer exception on the line where I call "facebook.authorizeCallback ()" inside the onActivityResult () method.

This has never happened on any of my mobile phones or emulators. However, I continue to receive user crash reports, mainly from Droid and T-Mobile myTouch 3G phones. I tried a lot, but could not reproduce the problem. Can any body understand what might be wrong?

+3
source share
3 answers

Facebook.java , DialogListener ... authorizeCallback() , DialogListener null. , (, G1), , facebook, DialogListener, autherizeCallback, , .

+2

Facebook.DialogListener.onComplete(Bundle values) catch facebookClient.authorizeCallback(requestCode, resultCode, data) NPE.

authorizeCallback, . authorizeCallback , , . , NPE, , .

+1

, chrash , , , . Android 4 " ", " ". , , SSO, . Facebook.class : mAuthDialogListener.onComplete(data.getExtras()); mAuthDialogListener null. , .

0

Source: https://habr.com/ru/post/1790923/


All Articles