in my activity I use the following code to get Facebook authorization. facebook.authorize
is called but it does not enter in one of the listener event (onComplete, onFacebookError...). Anybody could help?
Facebook facebook = new Facebook(FACEBOOK_APPID);
facebook.authorize(ItemDetail.this, new String[] {"publish_stream"},
new DialogListener() {
@Override
public void onComplete(Bundle values) {
Log.i("ItemDetail", "Facebook onComplete");
}
@Override
public void onFacebookError(FacebookError error) {
Log.i("ItemDetail", "Facebook onFacebookError");
}
@Override
public void onError(DialogError e) {
Log.i("ItemDetail", "Facebook onError");
}
@Override
public void onCancel() {
Log.i("ItemDetail", "Facebook onCancel");
}
}
);
You need to put this in your class:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
facebook.authorizeCallback(requestCode, resultCode, data);
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.