转成web,Android 从 Web 唤起 APP"/>
android原生app转成web,Android 从 Web 唤起 APP
前言
image
知乎在手机浏览器打开,会有个 App 内打开的按钮,点击直接打开且跳转到该详情页,是不是有点神奇,是如何做到的呢?
效果预览
[图片上传失败...(image-d606d-1523111217485)]
Uri Scheme
配置 intent-filter
AndroidManifest.xml
android:host="myhost"
android:path="/main"
android:port="1024"
android:scheme="myscheme" />
测试网页
main 下新建 assets 文件,写了简单的 Html 网页用于 WebView 展示,来进行测试。
index.html:
这是一个 WebView
open app with market
open app with Uri Scheme
Web View 加载:
webView.loadUrl("file:///android_asset/index.html");
目标页面
接受参数,做相应的处理。
Intent intent = getIntent();
if (null != intent
更多推荐
android原生app转成web,Android 从 Web 唤起 APP
发布评论