从一个应用程序切换到另一个应用程序

发布于 2024-12-21 22:27:55 字数 142 浏览 2 评论 0原文

我有一个问题要问你。当我点击 twitter 的(或 facebook、google+)图标时,我会在我的应用程序中访问我页面上的 twitter 应用程序,或者,如果用户没有 twitter,请访问 www.twitter.com/..... !我怎样才能做到这一点?

I have a question for you. I would who in my application when i click on twitter's (or facebook, google+) icon I go on twitter's application on my page or, if the user don't have twitter, go on www.twitter.com/...... ! How i can do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鲜肉鲜肉永远不皱 2024-12-28 22:27:55

您可以使用意图开始新的活动。请在这里查看这个问题:
如何在另一个应用程序中启动 Activity?

如果您想要启动 Activity start 不存在,startActivity() 抛出 ActivityNotFoundException。这样,如果抛出异常,您就知道用户没有安装 Twitter,并且您也可以使用意图打开网页。

请参阅此处:我该如何从我的应用程序在 Android 的网络浏览器中打开 URL?

You can start a new activity with the use of Intents. Please see this question here:
How to start activity in another application?

If the activity you want to start doesn't exist, startActivity() throws an ActivityNotFoundException. That way, if the exception is thrown you know the user doesn't have Twitter installed, and you can open a webpage also by using an intent.

See here: How can I open a URL in Android's web browser from my application?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文