I copied the source code of this popular question on how to make a “Rate This App”-link in Google Play store app on the phone .
On my Android Studio (version 3.1.2) with an Emulator this works perfectly. However, on my Samsung Galaxy A5 (2017) (Android 8.0) device the link always opens the Google Play app but shows me the start page instead of the app page.
I wonder why they are acting differently and what can I do to make it work on my device, too. I wonder if it is some setting I have on my device that prevents the deep link?
My code:
Uri uri = Uri.parse("market://details?id=" + getPackageName());
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY |
Intent.FLAG_ACTIVITY_NEW_DOCUMENT |
Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
try {
startActivity(goToMarket);
} catch (ActivityNotFoundException e) {
startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse("http://play.google.com/store/apps/details?id=" + getPackageName())));
}