androidx.webkit
Requirements
The minimum sdk version to use this library is 14.
How to declare the dependencies to use the library
Inside your app's build.gradle file, include this line in dependencies:dependencies {
...
implementation 'androidx.webkit:webkit:1.2.0'
}
Migrating to androidx.webkit
For static methods:
Old code:if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
WebView.startSafeBrowsing(appContext, callback);
}
New code:if (WebViewFeature.isFeatureSupported(WebViewFeature.START_SAFE_BROWSING)) {
WebViewCompat.startSafeBrowsing(appContext, callback);
}
Or, if you are using a non-static method:
Old code:if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
myWebView.postVisualStateCallback(requestId, callback);