Android FB Connect

时间:2011-09-08 10:03:24

标签: android facebook

我正在尝试整合官方FB SDK for android。 下面是基本代码

public class FbTestActivity extends Activity {
    Facebook facebook = new Facebook("112374492201730");

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        facebook.authorize(this, new String[] { "email", "read_stream" },

        new DialogListener() {

            public void onComplete(Bundle values) {
            }

            public void onFacebookError(FacebookError error) {
            }

            public void onError(DialogError e) {
            }

            public void onCancel() {

            }
        });
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        facebook.authorizeCallback(requestCode, resultCode, data);
    }
}

当我打开应用程序时,登录或(如果已进入)权限对话框永远不会显示。一些对话框打开几个mili秒并关闭。

1 个答案:

答案 0 :(得分:2)