1

I am trying to pass url to webview that should redirect to play store but Its not working.

What I tried :

String url = "https://play.google.com/store/apps/details?id=com.matchify";
webView.loadUrl(url);

but its loading only inside the webview, how can I solve this?

Thanks in advance

Aristo Michael
  • 2,166
  • 3
  • 35
  • 43

1 Answers1

1

To open your app's / any other app's page on play store app use :

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackName)));

Where appPackName is:

 String appPackName = getPackageName();

Play Store app has Intent Filter that will listen to the intent and launch the uri (since it is starting with market:// it will open Play Store. ) If you want to open in browser use uri argument :

https://play.google.com/store/apps/details?id=" + appPackName

Helpful link : How to open the Google Play Store directly from my Android application?

Community
  • 1
  • 1
Karan
  • 2,120
  • 15
  • 27