android的uri的组成为:scheme://authority/path/queryParts
其中的authority又分为host:port
android的scheme协议下的uri格式:
scheme://host:port/path/queryParameter=queryString
一.唤起外部应用的activity
1.目标activity必须在其AndroidManifest.xml中配置如下过滤器:
<intent-filter>
<action
android:name="android.intent.action.VIEW"/>
<category
android:name="android.intent.category.DEFAULT"/>
<data
android:scheme="artist"
android:host="first"
android:path="/enter"/>
</intent-filter>
2.然后启动方式就为:
Intent intent =
new Intent();
intent.setData(Uri.parse("artist://first/enter"));
startActivity(intent);
二.唤起应用内部activity
方式一:唤起外部应用的activity一样的步骤
方式二:
1.目标activity必须在其AndroidManifest.xml中配置如下过滤器:
<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:scheme="artist"
android:host="first"
android:path="/enter"/>
</intent-filter>
2.然后启动方式为:
WebView.loadUrl("artist://first/enter");