Closing Webview In Android
Solution 1:
You can't "close" a WebView. What you could do is hide it. Maybe this solution will shed some light - Hide WebView until JavaScript is done
Solution 2:
Well, you could
instead use another dedicated activity with mainly a webview [potentially also with 'done' button]. You could start that activity from your
onPostExecute
with intent, and then you will go back when user is done with it, or you could start that webview activity for resultAnother option is to replace your webview when you are done with another view, for example by calling
setContentView
with another layout. I never did this myself, and not sure it will work easily, but I found that some people recommend using ViewFlipper for similar effect.
Hope that helps.
Solution 3:
Add a close button and on its click set:
webview.setVisibility(View.INVISIBLE);
webview.loadUrl("");
You can then reduce the height width of the web view to minimum.
Solution 4:
You can call finish()
from anywhere inside the Activity class
Solution 5:
This works for me:
webview.destroy();
Post a Comment for "Closing Webview In Android"