clear Cookies via CookieSyncManager - Android Network

Android examples for Network:Cookie

Description

clear Cookies via CookieSyncManager

Demo Code


//package com.java2s;
import android.content.Context;
import android.webkit.CookieManager;
import android.webkit.CookieSyncManager;

public class Main {
    public static void clearCookies(Context context) {
        @SuppressWarnings("unused")
        CookieSyncManager cookieSyncMngr = CookieSyncManager
                .createInstance(context);
        CookieManager cookieManager = CookieManager.getInstance();
        cookieManager.removeAllCookie();
    }//from   w  w w.  ja v  a 2 s . c  o m
}

Related Tutorials