【发布时间】:2019-09-12 10:05:18
【问题描述】:
我创建了一个深层链接,但问题是它以“打开或使用其他应用程序”的形式打开一个对话框
我不想让用户决定选择对话框。我想直接打开我的应用程序。这是代码。
<activity android:name=".DeepLinkingActivity">
<intent-filter
android:autoVerify="true">
<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.google.com"
android:pathPrefix="/help"
android:scheme="https" />
</intent-filter>
</activity>
class DeepLinkingActivity : AppCompatActivity() {
var datas: Uri? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_deep_link)
}
override fun onResume() {
super.onResume()
var intent = intent
datas = intent.data
Log.v("TestingsDatas", "" + datas)
}
}
【问题讨论】:
-
那么你需要有自定义的 URI 方案/URL,而不是没有 HTTP 或 Https 的开头
标签: android kotlin applinks android-deep-link