【发布时间】:2015-01-02 17:25:03
【问题描述】:
当我尝试通过官方 Facebook 应用打开 Facebook 个人资料时,出现此错误:加载传记时出错,内容不可用。 我尝试了很多代码,但没有。仅当设备上未安装 Facebook 应用程序时,浏览器才能正常工作。 这是当前代码:
try
{
Intent followIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://profile/"+id_facebook));
startActivity(followIntent);
final Handler handler = new Handler();
handler.postDelayed(new Runnable()
{
@Override
public void run() {
Intent followIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://profile/"+id_facebook));
startActivity(followIntent);
}
}, 1000 * 2);
}
catch (Exception e)
{
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/"+id_facebook)));
String errorMessage = (e.getMessage()==null)?"Message is empty":e.getMessage();
Log.e("Unlock_ScreenActivity:FacebookAppNotFound" ,errorMessage);
}
更新:
当我放弃只放 https URI 时,Android 让我在 Facebook APP 和浏览器之间进行选择,我喜欢它!所以我的问题得到了回答=D
【问题讨论】:
-
你的应用有适当的权限吗?
-
没有办法做到这一点。
-
在 Facebook 的开发者页面或 AndroidManifest 中?在 AndroidManifest 我拥有所有的propers权限。