Faced such a problem:
I wrote an application for Android, with several screens, one of which is WebView . After a certain action on the first screen, the second screen (webview) should open and open the page that we set on the first screen. After 15 seconds, the application should return to the first screen.

By and large, it all works (although it hangs while waiting for these 15 seconds), but the question is: When you go to the screen with WebView application asks: which browser to start? and a choice of several options, including the screen with WebView .

Is it possible to prescribe in software to automatically launch WebView , without deleting other browsers from the phone and without setting it by default?

  • “the second screen (webview) should open” - does this mean “launching your Activity, in the markup of which there is a WebView, via the Intent? In general, we need the code with which you call this second Activity of yours. - JuriySPb ♦
  • startActivity (new Intent (Intent.ACTION_VIEW, Uri.parse (UrlServer))); - Jan Kurganov
  • and return to the first Activity via startActivity (new Intent (WebViewActivity.this, MainActivity.class)); - Jan Kurganov

1 answer 1

Your problem is that you offer the android to open the link in one of the ways known to it, instead of opening your activation.

You need to open the activation with WebView in the same way that you open the first activation and send the link through the intent to launch it.

PS I can only add the code in an hour and a half. From the application is not convenient.

  • thanks for the comment. Indeed, I rewrote the code and did not seem to ask: Intent intent3 = new Intent ("learn2crack.jsonparsing.Browser"); intent3.setData (Uri.parse (UrlServer)); startActivity (intent3); - Jan Kurganov
  • If the answer has solved the problem, then there is a tick off "to the right" =) - YuriySPb ♦