我使用的是 facebook sdk 2.0。今天我已将 facebook sdk 更新到 3.0。但是有登录问题。当我一次又一次地单击登录按钮时,一次或两次,在 10 到 12 个正确的登录对话框中打开,但其他尝试失败。这是我的代码:
Util.clearCookies(getApplicationContext());
String response = "";
if (!response.contains("Error")) {
SharedPreferences prefs = main.this.getSharedPreferences("userInformation", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = prefs.edit();
editor.putString("ImageURL", null);
editor.commit();
//SessionStore.clear(main.this);
loginSuccess = false;
// do
BLL_Friendlist chatFriendDataSource = new BLL_Friendlist(mActivity);
chatFriendDataSource.deleteAllRecordsInFriendList();
userImage.setImageUrl(null);
dummy_user_Image_view.setVisibility(View.VISIBLE);
/////////////////////////
mFacebook = new Facebook(APP_ID);
Session.waitForAuthCallback(mFacebook);
mFacebook.authorize(main.this, PERMISSIONS, new AppLoginListener(mFacebook));
mAsyncRunner = new AsyncFacebookRunner(mFacebook);
SessionStore.restore(mFacebook, getApplicationContext());
SessionEvents.addAuthListener(new SampleAuthListener());
SessionEvents.addLogoutListener(new SampleLogoutListener());
代码有什么问题?