public static Intent newGooglePlayIntent ( Context context , String packageName ) { Intent intent = new Intent ( Intent . ACTION_VIEW , Uri . parse ( "market://details?id=" + packageName ) ) ; if ( ! IntentUtils . isIntentAvailable ( context , intent ) ) { intent = MediaIntents . newOpenWebBrowserIntent ( "https://play.google.com/store/apps/details?id=" + packageName ) ; } if ( intent != null ) { intent . addFlags ( Intent . FLAG_ACTIVITY_NO_HISTORY | Intent . FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET ) ; } return intent ; }
Intent that should open either the Google Play app or if not available the web browser on the Google Play website