fix(android): webview crash with incognito in Android Lollipop (#799)
This commit is contained in:
parent
39e5373d3e
commit
47e9a0b97d
|
@ -367,7 +367,11 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
|
|||
@ReactProp(name = "incognito")
|
||||
public void setIncognito(WebView view, boolean enabled) {
|
||||
// Remove all previous cookies
|
||||
CookieManager.getInstance().removeAllCookies(null);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
CookieManager.getInstance().removeAllCookies(null);
|
||||
} else {
|
||||
CookieManager.getInstance().removeAllCookie();
|
||||
}
|
||||
|
||||
// Disable caching
|
||||
view.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
|
||||
|
|
Loading…
Reference in New Issue