How to launch the Google Play intent in ‘Give Feedback’ mode on Android?

Note that in order to make the activities flow more expected for the end user, you should consider adding some intent flags.
I suggest:

String appPackageName= getPackageName();
Intent marketIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id="+appPackageName));
marketIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET|Intent.FLAG_ACTIVITY_MULTIPLE_TASK|Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(marketIntent);

This way, when the user is pressing back, he will get to your application and not stay on the market (if he was there before). Also, if the user has opened your app again (after it was gone to the background), the market won’t show up.

You can also add a try catch for the startActivity() call, so that you will be able to show the website of the app if the market is not available (either uninstalled somehow, or because the device’s company didn’t include it).


EDIT: another alternative is How to use Intent.ACTION_APP_ERROR as a means for a “feedback” framework in Android?

Leave a Comment