안드로이드 웹뷰 쿠키, 세션, 히스토리 삭제 > 자료실

자료실

자료실

안드로이드 웹뷰 쿠키, 세션, 히스토리 삭제

페이지 정보

profile_image
작성자 최고관리자
댓글 0 조회 301회 작성일 23-02-16 19:24
작성일 23-02-16 19:24

본문

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

  • 회사 :
  • 대표 :
  • 주소 :
  • 메일 : admin@mysample.com
  • 사업자 등록번호 :
Copyright © cginjs.com All rights reserved.
notice