从一个应用程序切换到另一个应用程序
我有一个问题要问你。当我点击 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用意图开始新的活动。请在这里查看这个问题:
如何在另一个应用程序中启动 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?