Example usage for android.database.sqlite SQLiteDatabase releaseMemory

List of usage examples for android.database.sqlite SQLiteDatabase releaseMemory

Introduction

In this page you can find the example usage for android.database.sqlite SQLiteDatabase releaseMemory.

Prototype

public static int releaseMemory() 

Source Link

Document

Attempts to release memory that SQLite holds but does not require to operate properly.

Usage

From source file:com.panoskrt.dbadapter.DBAdapter.java

@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public void deleteDB() {
    File oldDB = new File(dbPath + dbName);
    SQLiteDatabase.releaseMemory();
    SQLiteDatabase.deleteDatabase(oldDB);
}

From source file:com.android.leanlauncher.LauncherTransitionable.java

@Override
public void onTrimMemory(int level) {
    super.onTrimMemory(level);
    if (level >= ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN) {
        // The widget preview db can result in holding onto over
        // 3MB of memory for caching which isn't necessary.
        SQLiteDatabase.releaseMemory();

        // This clears all widget bitmaps from the widget tray
        if (mAppsCustomizeTabHost != null) {
            mAppsCustomizeTabHost.trimMemory();
        }/*  w w  w.  j a v  a 2  s  . co m*/
    }
}

From source file:com.android.launcher3.Launcher.java

@Override
public void onTrimMemory(int level) {
    super.onTrimMemory(level);
    if (level >= ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN) {
        // The widget preview db can result in holding onto over
        // 3MB of memory for caching which isn't necessary.
        SQLiteDatabase.releaseMemory();

        // This clears all widget bitmaps from the widget tray
        // TODO(hyunyoungs)
    }/*from  w ww .  ja  v  a 2 s .  co m*/
    if (mLauncherCallbacks != null) {
        mLauncherCallbacks.onTrimMemory(level);
    }
}