How to open the Google Play Store directly from my Android application?

后端 未结 23 2747
既然无缘
既然无缘 2020-11-22 02:00

I have open the Google Play store using the following code

Intent i = new Intent(android.content.Intent.ACTION_VIEW);
i.setData(Uri.parse(\"https://play.goo         


        
23条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-22 02:07

    You can do:

    final Uri marketUri = Uri.parse("market://details?id=" + packageName);
    startActivity(new Intent(Intent.ACTION_VIEW, marketUri));
    

    get Reference here:

    You can also try the approach described in the accepted answer of this question: Cannot determine whether Google play store is installed or not on Android device

提交回复
热议问题