• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WebView in the app stayes only the first link..

 
Niklas Karlsson
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have a local weblinks, and all of them "stays in the app webview", no matter if i click on a "new local link".
if I then change the "local weblinks" to a network based link, I then get problems!

the network based link first open in the app webview (OK!)
BUT then if I click on any link Im asked to chose a web browser to open this "new" link.. ( :-( )

can I make the external links STAY on the App weblink and not open a new browser?

 
Tim Moores
Bartender
Posts: 3128
50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to set a WebViewClient that overrides the shouldOverrideUrlLoading method for all URLs you want the WebView to handle itself. The default is to open URLs externally via the chooser.
 
Niklas Karlsson
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:You need to set a WebViewClient that overrides the shouldOverrideUrlLoading method for all URLs you want the WebView to handle itself. The default is to open URLs externally via the chooser.


ok, interesting! i will try it,


is this on the right track?


but what happen is I have a telephone number that i want to still call then clicked, like i have now..
 
Tim Moores
Bartender
Posts: 3128
50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep, that's it. For differentiation according to protocol (phone numbers would have "tel", for example), check Uri.parse(url).getScheme() and return true or false accordingly.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic