问题描述
我的Android编程初学者。我试图使用Facebook SSO,所以我遵循的Facebook开发的指令,写一个简单的测试code:
I am a beginner of android programming. I am trying to use facebook SSO, therefore I follow the instruction of facebook developers and write a simple testing code:
public class MainActivity extends Activity {
private Facebook facebook = new Facebook("xxxxxxxxxxxxxxx");
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button btn = (Button) findViewById(R.id.button1);
btn.setOnClickListener(new OnClickListener(){
//@Override
public void onClick(View v) {
facebook.authorize( MainActivity.this, new DialogListener(){
@Override
public void onComplete(Bundle values) {
// TODO Auto-generated method stub
}
@Override
public void onFacebookError(FacebookError e) {
// TODO Auto-generated method stub
}
@Override
public void onError(DialogError e) {
// TODO Auto-generated method stub
}
@Override
public void onCancel() {
// TODO Auto-generated method stub
}
});
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
我第一次完成编码它的作品。对话框弹出,我可以输入我的电子邮件地址和密码。然而,在第一时间之后的同一斜面工作。我检查了LogCat中,找出错误:
The first time I finish the coding it works. The dialog pop out and I can input my email and password. However, the same cant work after the first time. I checked the LogCat and find out the error:
10-17 17:10:07.227: E/ActivityThread(638): Failed to find provider info for
com.facebook.katana.provider.AttributionIdProvider
我已经尝试了许多时间,我看到的是对话框弹出出来,但立即关闭。我已经检查了解决方案,我敢肯定,密钥散列匹配。谁能告诉我为什么吗?非常感谢。
I have tried many time and what I see is the dialog pop out but close immediately. I have checked for solution and I am sure that the Key Hash matched. Can anyone tell me why? Thanks a lot.
对不起,我愚蠢的问题。我发现,在LogCat中有一个D / Facebook的检查(638):登录成功的access_token = ... =到期.....,因此,我建议在codeS字?然而,为什么我不需要重新登录,即使我闭上仿真器,重新启动我的电脑?如何切换到其他的Facebook帐户,如果我想要什么? THX了很多。
Sorry for my stupid question. I have found that in the LogCat there is a "D/Facebook-authorize(638): Login Success! access_token=...... expires=.....", So I suggest the codes word? however why I dont need to login again even I close my emulator, reboot my computer? How can I switch to other facebook account if I want? Thx a lot.
推荐答案
我想登录就是成功。但这里的一些建议。
如果你想看到的对话框页面并希望重新输入用户名和密码,尝试清除缓存你第一次应用程式重新运行它。
I think the login is success. But here's are some suggestion.If you want to see the dialog page and want to re-enter the user name and password, try to clear the caches of yours apps first before running it again.
这篇关于在Android和QUOT着登录博客;未能找到com.facebook.katana.provider.AttributionIdProvider&QUOT提供信息;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!