Back to project page TipCalculator.Android.
The source code is released under:
MIT License
If you think the Android project TipCalculator.Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package net.alteridem.tipcalculator.utilites; /*www . j a va 2 s . co m*/ import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; import android.net.Uri; /** * Author: Rob.Prouse * Date: 2014-09-17. */ public class PlayStore { /** * Launches the Google Play store to the app page so the user can rate the app. * @param context */ public static void rateApp(Context context) { Uri uri = Uri.parse("market://details?id=" + context.getPackageName()); Intent intent = new Intent(Intent.ACTION_VIEW, uri); intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET | Intent.FLAG_ACTIVITY_MULTIPLE_TASK); try { context.startActivity(intent); } catch (ActivityNotFoundException e) { intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id=" + context.getPackageName())); intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET | Intent.FLAG_ACTIVITY_MULTIPLE_TASK); context.startActivity(intent); } } }