指定APP页面配置
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="www.myapp.com"
android:pathPrefix="/index.html"
android:scheme="http" / >
</intent-filter>
类似于网页< a href="http://www.myapp.com/index.html?data1=123&data2=456">Open Application</a>
在指定APP页面获取网页回调内容
读取数据data时
Intent intent = getIntent();
String action = intent.getAction();
if(Intent.ACTION_VIEW.equals(action)){
Uri uri = intent.getData();
if(uri != null){
String data1 = uri.getQueryParameter("data1");
String data2= uri.getQueryParameter("data2");
android.util.Log.v("data1", data1);
android.util.Log.v("data2", data2);
}
}
网友评论