clear All Cookies - Android Network

Android examples for Network:Cookie

Description

clear All Cookies

Demo Code


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

public class Main {
    public static void clearAllCookies(Context context) {
        if (context != null) {
            CookieSyncManager.createInstance(context);
            CookieManager.getInstance().removeAllCookie();
            CookieSyncManager.getInstance().sync();
        }//  www . ja  v a 2  s  . c  om
    }
}

Related Tutorials