web链接跳转安卓app的问题
2014-10-14 11:36
330 查看
Load a web URL
Google Now
"open example.com"
To open a web page, use the
ACTION_VIEWaction
and specify the web URL in the intent data.
Action
ACTION_VIEWData URI Scheme
http:<URL>
https:<URL>MIME Type
PLAIN_TEXT_TYPE(
"text/plain")
"text/html"
"application/xhtml+xml"
"application/vnd.wap.xhtml+xml"
Example intent:
public void openWebPage(String url) { Uri webpage = Uri.parse(url); Intent intent = new Intent(Intent.ACTION_VIEW, webpage); if (intent.resolveActivity(getPackageManager()) != null) { startActivity(intent); } }
Example intent filter:
<activity ...> <intent-filter> <action android:name="android.intent.action.VIEW" /> <!-- Include the host attribute if you want your app to respond only to URLs with your app's domain. --> <data android:scheme="http" android:host="www.example.com" /> <category android:name="android.intent.category.DEFAULT" /> <!-- The BROWSABLE category is required to get links from web pages. --> <category android:name="android.intent.category.BROWSABLE" /> </intent-filter> </activity>
Tip: If your Android app provides functionality similar to your web site, include an intent filter for URLs that point to your web site. Then, if users have your app installed, links from emails or other web pages pointing to your web site
open your Android app instead of your web page.
相关文章推荐
- web.xml直接跳转springmvc的链接问题
- [置顶] 使用Android的webview将web app打包成安卓的app和解决安卓webview不支持input type=file问题
- 解决AngularJS在安卓WebView中跳转时不刷新的问题
- JS和安卓互相调用以及Scheme协议完成外部链接跳转app指定页面
- 阻止 android webview 中的链接跳出APP(即跳转到系统浏览器)
- iOS实现在webview页面内点击链接,跳转指定App
- 安卓开发_关于WebView使用链接时调用浏览器显示的问题
- iOS实现在webview页面内点击链接,跳转指定App
- JS和安卓互相调用以及Scheme协议完成外部链接跳转app指定页面
- 小程序中webview链接跳转?参数中带有多个参数的的问题
- JS和安卓互相调用以及Scheme协议完成外部链接跳转app指定页面
- Android webview里加载显示网页,显示进度,点击网页链接跳转到app页面
- 安卓手机系统设置字体大小后与APP以及web端字体大小问题
- 关于android app跳转和从web跳转的问题(转载修正)
- Web.config或App.config中数据库链接路径的问题
- webview 笔记二(android和js交互、包括链接跳转常见问题处理,加载监视,拦截Url等)
- 如何使用URL跳转解决Web服务80端口被封问题
- 解决VS2008中Web项目中App_Code目录问题
- app.config的读写、更新问题 两篇链接
- wcf web service遇到"Could not load file or assembly App_Web..."问题