使用facebook sdk 3.0 for android的登录问题
我使用的是facebook sdk 2.0。今天我将facebook sdk更新为3.0。但是存在登录问题。 当我一次又一次地点击登录按钮时,有10到12个正确的登录对话框打开,但其他尝试都失败了。这是我的密码:使用facebook sdk 3.0 for android的登录问题,android,facebook,facebook-login,Android,Facebook,Facebook Login,我使用的是facebook sdk 2.0。今天我将facebook sdk更新为3.0。但是存在登录问题。 当我一次又一次地点击登录按钮时,有10到12个正确的登录对话框打开,但其他尝试都失败了。这是我的密码: Util.clearCookies(getApplicationContext()); String response = ""; if (!response.contains("Error")) { S
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());
代码有什么问题
首先,如果Android上没有facebook应用程序,登录屏幕需要一段时间。 第二: restore(mFacebook,getApplicationContext());如果您以前没有连接,则无法工作。试试这个