Hide default browser address bar in android

I am developing one Android application in which I need to open the URL in the default browser. But I do not want to show the address bar of the browser. How to solve the problem? Thanks for any help.

+4
source share
1 answer
public class WebViewDemoActivity extends Activity { WebView webView; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); webView = (WebView) findViewById(R.id.yourwebview); // force web view to open inside application webView.setWebViewClient(new MyWebViewClient()); openURL(); } private void openURL() { webView.loadUrl("http://google.co.in"); } private class MyWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } } } 

And the demo code link here is

+5
source

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


All Articles