我在最新的应用程序中有其他应用程序的链接,我就这样打开它们。
Uri uri = Uri.parse("url");
Intent intent = new Intent (Intent.ACTION_VIEW, uri);
startActivity(intent);
此代码打开Google Play商店的浏览器版本。
当试图从我的手机打开时,手机会提示我是想使用浏览器还是Google Play,如果我选择第二个,它会打开移动的版Google Play商店。
你能告诉我这是怎么发生的吗?我的意思是不问我,而是直接打开移动的版的Google Play,我看到的,而打开它直接从手机。
6条答案
按热度按时间xqnpmsa81#
您将需要使用指定的
market
协议:请记住,这将在任何没有安装Market的设备上崩溃(例如模拟器)。因此,我建议如下:
同时使用
Context
中的getPackageName()
或其子类以保持一致性(感谢@cprcrack!)。您可以在此处找到更多关于市场意图的信息:链接。twh00eeo2#
下面的代码可以帮助您在移动的版Google Play疮显示应用程序链接。
对于应用程序链接:
开发人员链接:
jei2mxaa3#
您可以使用Android Intents库在Google Play中打开应用页面,如下所示:
ajsxfq5m4#
您可以检查是否安装了 *Google Play商店 * 应用程序,如果是,您可以使用 “market://" 协议。
mzaanser5#
在Google Play上打开应用页面:
0tdrvxhp6#
在这种情况下,我们希望通过链接到本地Google Play商店应用程序来更新目的:
如果我们想打开即时应用程序链接这里是目的Kotlin代码:
请参阅Android开发人员链接:https://developer.android.com/distribute/marketing-tools/linking-to-google-play#android-app