4
我正在使用Facebook SDK 2.0。今天我已经更新Facebook的SDK到3.0。但是有登录问题。 当我点击一次又一次登录按钮,一个或两个时间,10到12个适当的登录对话框打开,但其他尝试失败。这里是我的代码:登录问题使用Facebook的SDK 3.0 for Android
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());
代码有什么问题?
试试这个http://developers.facebook.com/docs/howtos/androidsdk/3.0/login-with-facebook/ – 2013-02-27 06:01:59