Posts

Showing posts from December, 2020

how to set WebView in android studio

 Set your application on latest gradle version and now is running mostly androidx. you should carry it with android x. you have to set this code in your application and  XML Code <WebView android :id ="@+id/webv" android :layout_width ="match_parent" android :layout_height ="wrap_content" /> java code is WebView webView = findViewById(R.id. webv ) ; webView.loadUrl( "set your web address" ) ; WebSettings webSettings = webView.getSettings() ; webSettings.setJavaScriptEnabled( true ) ;

How to set Backpressed botton in android studio

Image
 let us know how to set backpressed in android application you can set in WebView and other online application. code is here. @Override     public void onBackPressed() {         WebView webView = findViewById(R.id.webv);         if (webView.canGoBack()){             webView.goBack();         }         else {             super.onBackPressed();         }