0

I have a webview which displays an animated image advertisement which when clicked should open a link to the play store. When I click the image it opens the link in the webview so it gives an error message trying to display a play store page. Is there a way to get the link and open the play store externally and not within the webview

user3074140
  • 457
  • 1
  • 10
  • 24

2 Answers2

2

You can extend the WebViewClient and override shouldOverrideUrlLoading(). Set the custom webview client to your webView. In method shouldOverrideUrlLoading check if the url is the Google play link, then return true (may be you need to start the browser intent by yourself).

Hope that help.

justHooman
  • 2,944
  • 2
  • 14
  • 15
0

I had the exact same problem

Try changing the url from https://play.google.com/store/apps/details?id=com.your.package.name to market://details?id=com.your.package.name

worked for me