Why does WebView in the SDK source code extend MockView?

In my Android studio, I found the source code of the WebView, but it seems empty and the top comment is:

/** * Mock version of the WebView. * Only non override public methods from the real WebView have been added in there. * Methods that take an unknown class as parameter or as return object, have been removed for now. * * TODO: generate automatically. * */ 

But on github, the Android source code is not, and it seems to be a real WebView .

So my question is why there are two different WebView source code, but what is MockView ?

+5
source share
1 answer

In the provided area, WebView in android.jar is a mock version, which is intended only for development purposes, with a web view of the mock version you can display the web view in the layout window, you can call the API in your code.

In the execution area, the WebView time will be replaced.

+3
source

All Articles