原创在https://blog.csdn.net/m0_37678565/article/details/68491444
在manifest文件中最开始启动的activity中添加:
android:host="host"
android:pathPrefix="/pathPrefix"
android:scheme="scheme" />
//注意host,pathPrefix,scheme都是自己自定义的,只要与h5页面调用的一致即可,如下所示
android:name=".activitys.MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait">
android:host="host"
android:pathPrefix="/pathPrefix"
android:scheme="scheme" />
如果要跳转到指定的页面,在MainActivity的onCreate()中添加:
Intent intent = getIntent();
Uri uri = intent.getData();
if (uri != null) {
String routeId = uri.getQueryParameter("pid");
Intent intent0 =