Android Autolink Launches WebView

I use autoLink = "web" in a TextView to launch a browser. However, I want to launch myActivity using a WebView when I click links in a TextView. Is it possible to catch the click event and trigger startActivity?

Thanks in advance, Jason

+3
source share
1 answer

Yes, this is pretty easy to do :)

  • Create a WebView with it and the corresponding settings.
  • In TextView, allow links to trigger intent instead.
  • Make it an intention that opens activity with a webview in it
  • In this target object, make myIntent.putExtra()and add the URL as an additional
  • , WebView, saveInstanceState.getExtras(), URL- WebView

, :

http://developer.android.com/guide/topics/intents/intents-filters.html

" Notepad" , , .

+2

Source: https://habr.com/ru/post/1747476/


All Articles