List of usage examples for android.webkit CookieManager removeAllCookie
@Deprecated public abstract void removeAllCookie();
From source file:Main.java
public static void removeAllCookies(Context context) { CookieSyncManager.createInstance(context); CookieManager cookieManager = CookieManager.getInstance(); cookieManager.removeAllCookie(); }
From source file:Main.java
public static void clearCookies(Context context) { @SuppressWarnings("unused") CookieSyncManager cookieSyncManager = CookieSyncManager.createInstance(context); CookieManager cookieManager = CookieManager.getInstance(); cookieManager.removeAllCookie(); }
From source file:Main.java
public static void clearCookies(Context context) { // Edge case: an illegal state exception is thrown if an instance of // CookieSyncManager has not be created. CookieSyncManager is normally // created by a WebKit view, but this might happen if you start the // app, restore saved state, and click logout before running a UI // dialog in a WebView -- in which case the app crashes try {/* www . j a v a 2s .co m*/ @SuppressWarnings("unused") CookieSyncManager cookieSyncMngr = CookieSyncManager.createInstance(context); CookieManager cookieManager = CookieManager.getInstance(); cookieManager.removeAllCookie(); } catch (Exception ex) { } }
From source file:Main.java
public static void clearCookies(Context context) { // Edge case: an illegal state exception is thrown if an instance of // CookieSyncManager has not be created. CookieSyncManager is normally // created by a WebKit view, but this might happen if you start the // app, restore saved state, and click logout before running a UI // dialog in a WebView -- in which case the app crashes @SuppressWarnings("unused") CookieSyncManager cookieSyncMngr = CookieSyncManager.createInstance(context); CookieManager cookieManager = CookieManager.getInstance(); cookieManager.removeAllCookie(); }
From source file:Main.java
@SuppressWarnings("deprecation") public static void clearCookies(Context context) { if (Build.VERSION.SDK_INT >= 21) { try {/*w ww . j a v a 2s. com*/ CookieManager.getInstance().removeAllCookies(null); CookieManager.getInstance().flush(); } catch (Exception e) { } } else { try { CookieSyncManager cookieSyncMngr = CookieSyncManager.createInstance(context); cookieSyncMngr.startSync(); CookieManager cookieManager = CookieManager.getInstance(); cookieManager.removeAllCookie(); cookieManager.removeSessionCookie(); cookieSyncMngr.stopSync(); cookieSyncMngr.sync(); } catch (Exception e) { } } }
From source file:Main.java
@SuppressWarnings("deprecation") private static void removeAllCookiesV14(Context context) { CookieSyncManager.createInstance(context); CookieManager cookieManager = CookieManager.getInstance(); cookieManager.removeAllCookie(); }
From source file:Main.java
@TargetApi(Build.VERSION_CODES.LOLLIPOP) public static void removeAllCookies() { CookieManager cookieManager = CookieManager.getInstance(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { cookieManager.removeAllCookies(null); } else {/* ww w. ja v a 2 s. com*/ //noinspection deprecation cookieManager.removeAllCookie(); } }
From source file:com.nguyenmp.gauchodroid.login.LoginFragment.java
public static void setCookies(Context context, CookieStore cookies) { PersistentCookieStore store = new PersistentCookieStore(context); store.clear();//from w w w.ja v a2 s . c om CookieSyncManager.createInstance(context); CookieManager cookieManager = CookieManager.getInstance(); cookieManager.removeAllCookie(); cookieManager.setAcceptCookie(true); if (cookies != null) { for (Cookie cookie : cookies.getCookies()) { store.addCookie(cookie); cookieManager.setCookie(cookie.getDomain(), cookie.getName() + "=" + cookie.getValue()); } } CookieSyncManager.getInstance().sync(); }
From source file:br.com.ufc.palestrasufc.twitter.Util.java
public static void clearCookies(Context context) { // Edge case: an illegal state exception is thrown if an instance of // CookieSyncManager has not be created. CookieSyncManager is normally // created by a WebKit view, but this might happen if you start the // app, restore saved state, and click logout before running a UI // dialog in a WebView -- in which case the app crashes @SuppressWarnings("unused") CookieSyncManager cookieSyncMngr = CookieSyncManager.createInstance(context); CookieManager cookieManager = CookieManager.getInstance(); cookieManager.removeAllCookie(); }
From source file:com.captix.scan.social.facebook.Util.java
public static void clearCookies(Context context) { // Edge case: an illegal state exception is thrown if an instance of // CookieSyncManager has not be created. CookieSyncManager is normally // created by a WebKit view, but this might happen if you start the // app, restore saved state, and click logout before running a UI // dialog in a WebView -- in which case the app crashes @SuppressWarnings("unused") CookieSyncManager cookieSyncMngr = CookieSyncManager.createInstance(context); CookieManager cookieManager = CookieManager.getInstance(); cookieManager.removeAllCookie(); }