我创建了一个应用程序,并将其与 Facebook 集成。
问题是 Facebook 包中有一个名为 Example 的类文件,它与名为 fb 的 xml 文件关联,但未从 fb.xml 中检索数据,它显示错误为
setContentView(R.layout.fb);
mLoginButton = (LoginButton) findViewById(R.id.login);
mText = (TextView) Example.this.findViewById(R.id.txt);
// mRequestButton = (Button) findViewById(R.id.requestButton);
mPostButton = (Button) findViewById(R.id.postButton);
mDeleteButton = (Button) findViewById(R.id.deletePostButton);
知道如何解决这个问题吗?
最佳答案
尝试检查按钮是否等于 null。如果是这样,则无法在 xml 中找到它们。这意味着您的 xml 包含错误。错误日志是什么?
关于java - 如何集成 Facebook api,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5103484/