How do I open link in webpage to new activity (what contains WebView aswell)?
I have webpage where is list and every list item contain different link. So I want that when user press first item it opens second activity and load that link to second activity's WebView. Hope you understand what I try to ask :)
Is that possible?
You can override the URL link clicks and open an activity on each click:
webView = new WebView(this);
webView.setWebViewClient(new WebViewClient()
{
// Override URL
public boolean shouldOverrideUrlLoading(WebView view, String url)
{
Intent intent = new Intent(...);
startActivity(intent);
return true;
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With