gpt4 book ai didi

android - 如果它安装在设备中,如何从链接启动我的应用程序

转载 作者:行者123 更新时间:2023-11-30 02:39:37 24 4
gpt4 key购买 nike

<data
android:ssp="com.faithmusicmissions.cloudapp"
android:path="/store/apps/details"
android:host="play.google.com"
android:scheme="https" />

使用此代码,我尝试从 Play 商店链接打开我的应用程序,
https://play.google.com/store/apps/details?id=com.faithmusicmissions.cloudapp

此代码有效,但问题是当我单击其他包含“play.google.com”的应用程序链接时,它还会提供打开我的应用程序的选项

例如我的电子邮件中有 2 个 Play 商店应用程序链接,其中一个是我的应用程序链接,另一个是另一个应用程序链接
1. https://play.google.com/store/apps/details?id=com.faithmusicmissions.cloudapp
2. https://play.google.com/store/apps/details?id=com.tradiesfriend.tradie

当我点击两个链接时,它们会显示相同的选择器对话框来启动我的应用程序

如何为此 https://play.google.com/store/apps/details?id=com.faithmusicmissions.cloudapp 在元素中使用我的应用程序链接

最佳答案

    Manifest file 

<activity
android:name=".SplashScreenActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" >
</category>
</intent-filter>
<intent-filter android:label="@string/app_name" >
<action android:name="android.intent.action.VIEW" >
</action>

<data
android:host="xxx.com"
android:scheme="http" >
</data>

<category android:name="android.intent.category.DEFAULT" >
</category>
<category android:name="android.intent.category.BROWSABLE" >
</category>
</intent-filter>
</activity>

if want to access url
In activty

try {
Uri intentUri = getIntent().getData();
Log.d(TAG, "Request intentUri: "+intentUri);

} catch (Exception e) {
Log.i(TAG, "Request intentUri: " , e);
}

关于android - 如果它安装在设备中,如何从链接启动我的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25968300/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com