Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide unhide webview in android

I develop application which has webview and imageview(as toogle button), if button clicked then webview will be closed, if button clicked again, then webview will be opened. Is it possible in android? see the circle red with up arrow which can hide and unhide above banner My reference like this application enter image description here

like image 423
Agoeng Liu Avatar asked Nov 29 '13 09:11

Agoeng Liu


People also ask

How do I close WebView on Android?

Add a close button and on its click set: webview. setVisibility(View. INVISIBLE); webview.

Is Android WebView deprecated?

This interface was deprecated in API level 12. This interface is now obsolete.

How do you prevent the WebView from invoking the device's web browser when a redirection occurs in the WebView?

To detect and intercept any redirection from WebView , we can use shouldOverrideUrlLoading and return true if it is supported to redirect into native page so that WebView stop the URL redirection in the web page and stay in the current page.

Is WebView a browser?

Android WebView is a system component for the Android operating system (OS) that allows Android apps to display content from the web directly inside an application.


1 Answers

for hide the webview

mWebView.setVisibility(View.GONE);

for show the webview

mWebView.setVisibility(View.VISIBLE); 
like image 156
Hardik Avatar answered Sep 19 '22 18:09

Hardik