Skip to content

Instantly share code, notes, and snippets.

@shameemreza
Last active March 13, 2018 07:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shameemreza/d887b6ae1e86053f7abebe734122ab9a to your computer and use it in GitHub Desktop.
Save shameemreza/d887b6ae1e86053f7abebe734122ab9a to your computer and use it in GitHub Desktop.
//Try Google play
intent.setData(Uri.parse("market://details?id=com.cubeactive.qnotelistfree"));
if (!MyStartActivity(intent)) {
//Market (Google play) app seems not installed, let's try to open a webbrowser
intent.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.melopixels.mastiunlimited"));
if (!MyStartActivity(intent)) {
//Well if this also fails, we have run out of options, inform the user.
Toast.makeText(this, "Could not open Android market, please install the market app.", Toast.LENGTH_SHORT).show();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment