【发布时间】:2016-09-15 10:46:36
【问题描述】:
如何从用户名打开 Facebook 个人资料?或者我应该在 Android 中使用哪个请求来获取(和打开)Facebook 个人资料。
Intent intent;
try {
activity.getPackageManager()
.getPackageInfo("com.facebook.katana", 0); // Checks if FB is even installed.
intent = new Intent(Intent.ACTION_VIEW,
Uri.parse("fb://profile/" + famous)); // Trys to make intent with FB's URI
} catch (Exception e) {
intent = new Intent(Intent.ACTION_VIEW,
Uri.parse("https://www.facebook.com/" + famous)); // catches and opens a url to the desired page
}
activity.startActivity(intent);
尝试过,但无法使用用户名(转到用户的 - 已登录的用户 - 墙)和 id(静态插入,显示错误 - 无法加载此配置文件)...
【问题讨论】:
标签: android facebook android-studio android-intent