The webview of Android Studio notes-realize that the app itself opens the web page without jumping to other browsers (built-in browser)

Android Studio notes webview

If you want to know the video part of the loading webpage, click here

Basic grammar

Insert picture description here
Insert picture description here
Insert picture description here

Actual combat drill

1. Load local html

Project structure
Insert picture description herepay attention to path writing
Insert picture description here

2. Load web html

Solve the problem of clicking on the link in the page to prompt to open the browser
Insert picture description here
Solve the problem of exiting the activity by the return key
Insert picture description here
Solve the progress bar and title function during loading
Insert picture description here
Use js to realize the pop-up
Insert picture description here

Also pay attention to setting network access permissions in androidmanifest

<uses-permission android:name="android.permission.INTERNET"></uses-permission>

The corresponding code above:**

Guess you like

Origin blog.csdn.net/qq_43398404/article/details/109262923