clear Cookies for WebKit - Android User Interface

Android examples for User Interface:WebKit

Description

clear Cookies for WebKit

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, String url) {
        CookieSyncManager.createInstance(context);
        CookieManager cookieManager = CookieManager.getInstance();
        cookieManager.setAcceptCookie(true);
        cookieManager.removeSessionCookie();
        cookieManager.removeAllCookie();
        CookieSyncManager.getInstance().sync();
    }/*w  w  w  .  j av a2 s . c  o m*/
}

Related Tutorials