Android Studio
(Andorid Studio) 웹뷰 쿠키 삭제, 캐시 삭제
SAFE
2016. 5. 20. 10:53
웹뷰 쿠키 삭제 관련
출처 3개
http://devbible.tistory.com/200
http://theeye.pe.kr/archives/1179
>> 이게 됨
http://www.androidpub.com/250419
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.removeAllCookie();
================
웹뷰 다루기 힘들다. 일단 웹뷰에서 동영상 보려면
연결부위를 만들어줘야하는 것 같다.
=================
캐시삭제 관련
하이브리드앱에서 사용 할 수 있다는데 사용 해봤다가 필요없어서 코드 삭제
출처 : http://fimtrus.tistory.com/entry/Android-%EC%95%B1-%EC%BA%90%EC%8B%9C-%EC%A0%9C%EA%B1%B0Webview-%EB%93%B1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | /** * 앱 캐시를 가차없이 지운다. */ public static void clearApplicationCache(Context context, File file) { File dir = null; if (file == null) { dir = context.getCacheDir(); } else { dir = file; } if (dir == null) return; File[] children = dir.listFiles(); try { for (int i = 0; i < children.length; i++) if (children[i].isDirectory()) MainActivity.clearApplicationCache(context, children[i]); else children[i].delete(); } catch (Exception e) { } }; | cs |