안드로이드 웹뷰 쿠키, 세션, 히스토리 삭제
페이지 정보
본문
webView.clearCache(true);
webView.clearHistory();
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
CookieSyncManager cookieSyncMngr=CookieSyncManager.createInstance(MainActivity.this);
cookieSyncMngr.startSync();
CookieManager cookieManager=CookieManager.getInstance();
cookieManager.removeAllCookie();
cookieManager.removeSessionCookie();
cookieSyncMngr.stopSync();
cookieSyncMngr.sync();
}else {
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.removeAllCookies(new ValueCallback() {
@Override
public void onReceiveValue(Boolean value) {
Log.d("onReceiveValue", value.toString());
}
});
cookieManager.getInstance().flush();
}
추천
0
비추천
0
- 이전글 안드로이드 뒤로 가기 버튼 클릭하면 안내창 띄우기(다이얼로그) 23.02.17
- 다음글 웹뷰(webview) 자주 쓰는 10가지 셋팅 23.02.16

