h5页面唤醒APP指定页面并传参

开发时有时会碰到这样的需求,分享到第三方的h5页面,在点击操作的时候需要跳回APP的指定页面,这时只需要在该activity下面配置一下相应的scheme host等信息就可以了


<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.BROWSABLE" />
    <category android:name="android.intent.category.DEFAULT"/>
    <data
        android:host="myapp"
        android:scheme="app"
        android:path="/wakeapp"
        />
intent-filter>
h5操作 链接格式例如 app://myapp/wakeapp?param=1

客户端取值
Uri uridata = this.getIntent().getData();
String id=uridata.getQueryParameter("param");


你可能感兴趣的:(Android,html5)