html
<a href="[scheme]://[host]/[path]?[query]">启动应用程序</a>
android
- manifest
<activity android:name="com.ttj.v2pro.ui.TestActivity"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<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="ttj" android:host="splash" />
</intent-filter>
</activity>
- activity
override fun onNewIntent(intent: Intent?)
{
super.onNewIntent(intent)
if (intent != null && intent.action == Intent.ACTION_VIEW)
{
val uri = intent.data
if (uri != null)
{
val name = uri.getQueryParameter("name")
toast("onNewIntent:" + name)
}
}
}
网友评论