Example usage for android.net.http HttpResponseCache flush

List of usage examples for android.net.http HttpResponseCache flush

Introduction

In this page you can find the example usage for android.net.http HttpResponseCache flush.

Prototype

public void flush() 

Source Link

Document

Force buffered operations to the filesystem.

Usage

From source file:net.v00d00.xr.HomeActivity.java

@Override
protected void onStop() {
    HttpResponseCache cache = HttpResponseCache.getInstalled();
    if (cache != null) {
        cache.flush();
    }//from   w ww.ja v  a2s.c  om

    eventBus.unregister(this);
    super.onStop();
}

From source file:com.fastbootmobile.encore.app.MainActivity.java

@Override
protected void onDestroy() {
    HttpResponseCache cache = HttpResponseCache.getInstalled();
    if (cache != null) {
        cache.flush();
    }//from   w  w  w . ja v  a 2s .c om

    // Release services connections if playback isn't happening
    PluginsLookup.getDefault().releasePlaybackServiceIfPossible();
    ImageCache.getDefault().evictAll();
    System.gc();

    super.onDestroy();
}

From source file:com.irccloud.android.activity.UploadsActivity.java

@Override
protected void onDestroy() {
    super.onDestroy();
    if (adapter != null)
        adapter.clear();//from  w w  w.  j a  v  a2  s  .  co  m

    if (mDownloadThreadPool != null)
        mDownloadThreadPool.shutdownNow();
    if (Build.VERSION.SDK_INT >= 14) {
        HttpResponseCache cache = HttpResponseCache.getInstalled();
        if (cache != null) {
            cache.flush();
        }
    }
}