Example analysis of WebView usage in Android

This article illustrates the usage of WebView in Android. Share it with you for your reference, as follows: @ h_ 404_ 1@

WebView is equivalent to a mini browser and adopts WebKit kernel, so it perfectly supports HTML, JavaScript, CSS, etc. Several points should be paid attention to in the development process: @ h_ 404_ 1@

1. The license "Android. Permission. Internet" must be used in androidmanifest.xml, otherwise a web page not available error will appear. 2. If there is JavaScript in the accessed page, the WebView must be set to support JavaScript.

4. If you browse the web page without any processing, click the "back" button of the system, and the whole browser will call finish() to end itself. If you want the browsed web page to fall back instead of pushing out the browser, you need to process and consume the back event in the current activity@ H_ 404_ 1@

Example: @ h_ 404_ 1@

Java file code: @ h_ 404_ 1@

Operation effect: @ h_ 404_ 1@

@H_ 404_ 1@@H_ 404_ 1@

WebView refreshes the current page:

I hope this article will help you in Android programming@ H_ 404_ 1@

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>