有谁知道这个错误是什么意思?每次我将我的 android 应用程序连接到 Facebook(通过模拟器)时,我都会在 LogCat shell 中得到它。
负责授权功能的代码:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.authorize);
mPrefs = getPreferences(MODE_PRIVATE);
loginPref = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
String access_token = mPrefs.getString("access_token", null);
long expires = mPrefs.getLong("access_expires", 0);
if(access_token != null) {
Singelton.mFacebook.setAccessToken(access_token);
}
if(expires != 0) {
Singelton.mFacebook.setAccessExpires(expires);
}
Singelton.mFacebook.authorize(this, new String[] {"email","user_birthday"}, new DialogListener() {
@Override
public void onComplete(Bundle values) {
SharedPreferences.Editor editor = mPrefs.edit();
editor.putString("access_token", Singelton.mFacebook.getAccessToken());
editor.putLong("access_expires", Singelton.mFacebook.getAccessExpires());
editor.commit();
SharedPreferences.Editor logEditor = loginPref.edit();
logEditor.putBoolean("login", true);
logEditor.commit();
addUser();
}
@Override
public void onFacebookError(FacebookError error) {
errorHandler();
}
@Override
public void onError(DialogError e) {
errorHandler();
}
@Override
public void onCancel() {
Log.d("MyApp", "Facebook cancel");
}
});
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Singelton.mFacebook.authorizeCallback(requestCode, resultCode, data);
}