mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-20 22:26:54 +01:00
toss cache after reading in new DB
This commit is contained in:
parent
3ccc9ac0f1
commit
e9efc27d7a
1 changed files with 3 additions and 1 deletions
|
@ -991,10 +991,11 @@ public class DBUtils {
|
||||||
if ( null == s_groupsCache ) {
|
if ( null == s_groupsCache ) {
|
||||||
HashMap<Long,GameGroupInfo> result =
|
HashMap<Long,GameGroupInfo> result =
|
||||||
new HashMap<Long,GameGroupInfo>();
|
new HashMap<Long,GameGroupInfo>();
|
||||||
initDB( context );
|
|
||||||
String[] columns = { ROW_ID, DBHelper.GROUPNAME,
|
String[] columns = { ROW_ID, DBHelper.GROUPNAME,
|
||||||
DBHelper.EXPANDED };
|
DBHelper.EXPANDED };
|
||||||
String limit = 0 == nRows ? null : String.format( "%d", nRows );
|
String limit = 0 == nRows ? null : String.format( "%d", nRows );
|
||||||
|
|
||||||
|
initDB( context );
|
||||||
synchronized( s_dbHelper ) {
|
synchronized( s_dbHelper ) {
|
||||||
SQLiteDatabase db = s_dbHelper.getReadableDatabase();
|
SQLiteDatabase db = s_dbHelper.getReadableDatabase();
|
||||||
Cursor cursor = db.query( DBHelper.TABLE_NAME_GROUPS, columns,
|
Cursor cursor = db.query( DBHelper.TABLE_NAME_GROUPS, columns,
|
||||||
|
@ -1576,6 +1577,7 @@ public class DBUtils {
|
||||||
FileOutputStream dest =
|
FileOutputStream dest =
|
||||||
new FileOutputStream( toSDCard? sdcardDB : gamesDB );
|
new FileOutputStream( toSDCard? sdcardDB : gamesDB );
|
||||||
copyFileStream( dest, src );
|
copyFileStream( dest, src );
|
||||||
|
invalGroupsCache();
|
||||||
}
|
}
|
||||||
} catch( java.io.FileNotFoundException fnfe ) {
|
} catch( java.io.FileNotFoundException fnfe ) {
|
||||||
DbgUtils.loge( fnfe );
|
DbgUtils.loge( fnfe );
|
||||||
|
|
Loading…
Reference in a new issue