Code example for CookieManager

Methods: getCookieStore

0
   * @return true if cookies were cleared; false otherwise 
   */ 
  public static boolean clearCookies(CookieHandler cookieHandler) {
    if (cookieHandler instanceof CookieManager) {
      CookieManager cookieManager = (CookieManager) cookieHandler;
      CookieStore cookieStore = cookieManager.getCookieStore();
      if (cookieStore != null) {
        cookieStore.removeAll();
        return true; 
      } 
    } 
    return false; 
  } 
 
  /** 
   * Creates a new NfcAdapter instance. 
   */ 
  public static NfcAdapter newNfcAdapter(Context context) {
    return NfcAdapter.getDefaultAdapter(context);
  }