gpt4 book ai didi

android - 从 Android 应用程序打开 Twitter 帐户

转载 作者:行者123 更新时间:2023-11-29 01:04:09 25 4
gpt4 key购买 nike

我正在尝试使用以下代码从我的 Android 应用程序打开 Twitter 帐户。但它失败并收到此消息。

cannot get users at this time please try again later

代码

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);
}

最佳答案

尝试使用它(将 user_id 更改为 screen_name):

"twitter://user?screen_name=" + mTwitterHandle

关于android - 从 Android 应用程序打开 Twitter 帐户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48816342/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com