Last active
August 29, 2015 14:07
-
-
Save scruffyfox/a6b6cc13c8da72c02677 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
Intent firstAidIntent; | |
PackageManager manager = getPackageManager(); | |
try | |
{ | |
firstAidIntent = manager.getLaunchIntentForPackage("com.cube.arc.fa"); | |
if (firstAidIntent == null) | |
{ | |
throw new PackageManager.NameNotFoundException(); | |
} | |
firstAidIntent.addCategory(Intent.CATEGORY_LAUNCHER); | |
startActivity(firstAidIntent); | |
} | |
catch (PackageManager.NameNotFoundException e) | |
{ | |
firstAidIntent = new Intent(Intent.ACTION_VIEW); | |
firstAidIntent.setData(Uri.parse("market://details?id=com.cube.arc.fa")); | |
startActivity(firstAidIntent); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment