user3074140
user3074140

Reputation: 857

open app store from webview link

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

Upvotes: 0

Views: 841

Answers (2)

ZazimDev
ZazimDev

Reputation: 1

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

Upvotes: 0

justHooman
justHooman

Reputation: 3054

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.

Upvotes: 2

Related Questions