IT. Expert System.

Android Reference

CookieSyncManager


android.webkit

Class CookieSyncManager

  • All Implemented Interfaces:
    Runnable


    public final class CookieSyncManager
    extends Object
    The CookieSyncManager is used to synchronize the browser cookie store between RAM and permanent storage. To get the best performance, browser cookies are saved in RAM. A separate thread saves the cookies between, driven by a timer.

    To use the CookieSyncManager, the host application has to call the following when the application starts:

    CookieSyncManager.createInstance(context)

    To set up for sync, the host application has to call

    CookieSyncManager.getInstance().startSync()

    in Activity.onResume(), and call

     CookieSyncManager.getInstance().stopSync()
     

    in Activity.onPause().

    To get instant sync instead of waiting for the timer to trigger, the host can call

    CookieSyncManager.getInstance().sync()

    The sync interval is 5 minutes, so you will want to force syncs manually anyway, for instance in WebViewClient.onPageFinished(android.webkit.WebView, java.lang.String). Note that even sync() happens asynchronously, so don't do it just as your activity is shutting down.

    • Method Detail

      • createInstance

        public static CookieSyncManager createInstance(Context context)
        Create a singleton CookieSyncManager within a context
        Parameters:
        context -
        Returns:
        CookieSyncManager
      • syncFromRamToFlash

        protected void syncFromRamToFlash()
      • clone

        protected Object clone()
                        throws CloneNotSupportedException
        Description copied from class: Object
        Creates and returns a copy of this Object. The default implementation returns a so-called "shallow" copy: It creates a new instance of the same class and then copies the field values (including object references) from this instance to the new instance. A "deep" copy, in contrast, would also recursively clone nested objects. A subclass that needs to implement this kind of cloning should call super.clone() to create the new instance and then create deep copies of the nested, mutable objects.
        Overrides:
        clone in class Object
        Returns:
        a copy of this object.
        Throws:
        CloneNotSupportedException - if this object's class does not implement the Cloneable interface.
      • run

        public void run()
        Description copied from interface: Runnable
        Starts executing the active part of the class' code. This method is called when a thread is started that has been created with a class which implements Runnable.
        Specified by:
        run in interface Runnable
      • sync

        public void sync()
        sync() forces sync manager to sync now
      • resetSync

        public void resetSync()
        resetSync() resets sync manager's timer
      • startSync

        public void startSync()
        startSync() requests sync manager to start sync
      • stopSync

        public void stopSync()
        stopSync() requests sync manager to stop sync. remove any SYNC_MESSAGE in the queue to break the sync loop
      • onSyncInit

        protected void onSyncInit()


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 2870 / . Delta: 0.03819 с