- add activity for BROWSABLE intent and url scheme protocol
<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="yl.app"
android:pathPrefix="/yes"
android:scheme="m" />
</intent-filter>
- new html file
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<a href="m://yl.app/yes?name=wangzhe&age=156">local3</a><br/>
</body>
</html>
- install app 2 android phone ,run .
extends get query param for different activity
Intent intent = getIntent();
String path = intent.getStringExtra("path");
String act = intent.getAction();
if (Intent.ACTION_VIEW.equals(act)) {
Uri uri = intent.getData();
String name = uri.getQueryParameter("name");
String age = uri.getQueryParameter("age");
Log.e("test", "测试:" + name + age);
}
#android studio debug yeshen monitor
cd E:\work\wechatdevelop\book\androidsdk\sdk\platform-tools
adb connect 127.0.0.1:62001