2016年1月8日 星期五

Open Google Play Store for your application

Reference:

http://stackoverflow.com/questions/11753000/how-to-open-the-google-play-store-directly-from-my-android-application

Code snippet:

String appPackageName = "Your app package name";
try {
    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
} catch (android.content.ActivityNotFoundException anfe) {
    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName)));
}

沒有留言: