From e9efc27d7a69c8ae779d5f8bbfd759020f95b172 Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 3 Dec 2013 07:54:38 -0800 Subject: [PATCH] toss cache after reading in new DB --- .../android/XWords4/src/org/eehouse/android/xw4/DBUtils.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java index 7b51936f3..7e58c336f 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java @@ -991,10 +991,11 @@ public class DBUtils { if ( null == s_groupsCache ) { HashMap result = new HashMap(); - initDB( context ); String[] columns = { ROW_ID, DBHelper.GROUPNAME, DBHelper.EXPANDED }; String limit = 0 == nRows ? null : String.format( "%d", nRows ); + + initDB( context ); synchronized( s_dbHelper ) { SQLiteDatabase db = s_dbHelper.getReadableDatabase(); Cursor cursor = db.query( DBHelper.TABLE_NAME_GROUPS, columns, @@ -1576,6 +1577,7 @@ public class DBUtils { FileOutputStream dest = new FileOutputStream( toSDCard? sdcardDB : gamesDB ); copyFileStream( dest, src ); + invalGroupsCache(); } } catch( java.io.FileNotFoundException fnfe ) { DbgUtils.loge( fnfe );