Open Android Market from link in WebView

cbanks

Active Member
Licensed User
Longtime User
Is it possible to click on a link in a WebView and have it go to a particular app in the Android Market app? If so, what is the code for that? Thanks.
 

Kevin

Well-Known Member
Licensed User
Longtime User
I'm pretty sure that I have read that opening a normal market URL on an Android phone will automatically open it in the market app, so in that case:

B4X:
Dim fURI as String
fURI = "https://market.android.com/details?id=[B]YourPackageName[/B]"
Dim Browser As PhoneIntents
StartActivity (Browser.OpenBrowser (fURI))


Alternatively, you can directly open it in the market app using an intent like this:

B4X:
Dim fURI as String
fURI = "market://details?id=[B]YourPackageName[/B]"
Dim Market As Intent
Market.Initialize(Market.ACTION_VIEW,fURI)
StartActivity (Market)

Hope that helps. I've never used the Webview, so if you were looking more for something else, then I apologize. :D
 
Upvote 0
Top