我正在尝试整合官方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秒并关闭。
答案 0 :(得分:2)