从android应用程序打开twitter帐户
我正在尝试使用以下代码从我的android应用程序打开twitter帐户。但是它失败了,并且得到了这个信息 此时无法获取用户,请稍后再试 代码 尝试使用此选项(将从android应用程序打开twitter帐户,android,twitter,Android,Twitter,我正在尝试使用以下代码从我的android应用程序打开twitter帐户。但是它失败了,并且得到了这个信息 此时无法获取用户,请稍后再试 代码 尝试使用此选项(将user\u id更改为screen\u name): public static void openTwitterHandle(String mTwitterHandle, FragmentActivity activity) { Intent intent = null; try { activi
user\u id
更改为screen\u name
):
public static void openTwitterHandle(String mTwitterHandle, FragmentActivity activity) {
Intent intent = null;
try {
activity.getPackageManager().getPackageInfo("com.twitter.android", 0);
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("twitter://user?user_id=" + mTwitterHandle));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
} catch (Exception e) {
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://twitter.com/" + mTwitterHandle));
}
activity.startActivity(intent);
}
"twitter://user?screen_name=" + mTwitterHandle