【发布时间】:2020-10-20 11:03:41
【问题描述】:
当用户点击链接时,我尝试直接打开我的应用,而不打开 google play 商店或浏览器。
我试过这段代码:
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
<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="fptest"
android:host="forgot"
android:pathPrefix="/"/>
</intent-filter>
</activity>
I'm using link as follows
<a href="intent://TestApplication#Intent;scheme=fptest;package=com.example.testapplication;end">
Open App
</a>
where ,
TestApplication -- my app name
package -- com.example.testapplication
但它总是打开 Google Play 或浏览器,而不是我的应用。
我想从链接打开我的应用程序,例如:fptest://forgot。我不想使用 http 作为方案
【问题讨论】:
标签: android deep-linking intentfilter