Search in sources :

Example 36 with CookieManager

use of android.webkit.CookieManager in project Lightning-Browser by anthonycr.

the class WebUtils method clearCookies.

public static void clearCookies(@NonNull Context context) {
    CookieManager c = CookieManager.getInstance();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        c.removeAllCookies(null);
    } else {
        //noinspection deprecation
        CookieSyncManager.createInstance(context);
        //noinspection deprecation
        c.removeAllCookie();
    }
}
Also used : CookieManager(android.webkit.CookieManager)

Aggregations

CookieManager (android.webkit.CookieManager)36 CookieSyncManager (android.webkit.CookieSyncManager)9 Test (org.junit.Test)7 WebView (android.webkit.WebView)4 SuppressLint (android.annotation.SuppressLint)3 WebSettings (android.webkit.WebSettings)3 Context (android.content.Context)2 Intent (android.content.Intent)2 Editor (android.content.SharedPreferences.Editor)2 Uri (android.net.Uri)2 View (android.view.View)2 WebViewClient (android.webkit.WebViewClient)2 TextView (android.widget.TextView)2 TargetApi (android.annotation.TargetApi)1 ActionBar (android.app.ActionBar)1 AlarmManager (android.app.AlarmManager)1 AlertDialog (android.app.AlertDialog)1 PendingIntent (android.app.PendingIntent)1 DialogInterface (android.content.DialogInterface)1 SharedPreferences (android.content.SharedPreferences)1