开发者

Issue with Android Facebook SDK

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");
开发者_Python百科             }

             @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);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜