Advertisement
Guest User

LocalCast

a guest
Mar 17th, 2017
968,583
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. PackageManager pm = context.getPackageManager();
  2. boolean isInstalled = isPackageInstalled("de.stefanpledl.localcast", pm);
  3.  
  4. if(isInstalled){
  5.     openLocalcastPlayer(...);
  6. }else{
  7.     try {
  8.         startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=de.stefanpledl.localcast")));
  9.     } catch (android.content.ActivityNotFoundException ignored) {
  10.         startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=de.stefanpledl.localcast")));
  11.     }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement