Created
February 15, 2018 06:41
-
-
Save VarunBarad/c6a799610c82005e60908a6b2e46f490 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Java | |
public void rateApp(View rateMeButton) { | |
String packageName = this.getPackageName(); | |
String playStoreAppUri = "market://details?id=" + packageName; | |
String playStoreSiteUri = "https://play.google.com/store/apps/details?id=" + packageName; | |
try { | |
Intent playStoreAppIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(playStoreAppUri)); | |
startActivity(playStoreAppIntent); | |
} catch (ActivityNotFoundException e) { | |
Intent playStoreBrowserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(playStoreSiteUri)); | |
startActivity(playStoreBrowserIntent); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment