From 6bb2a9bb9added4406ccc4e5170af9af4c8f5ad9 Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 7 Aug 2013 23:36:17 -0700 Subject: [PATCH 1/2] fix crash upgrading from beta 30 (which is two years old!) --- .../src/org/eehouse/android/xw4/DBHelper.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBHelper.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBHelper.java index a1ce7b2fc..43a5303f6 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBHelper.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBHelper.java @@ -300,7 +300,7 @@ public class DBHelper extends SQLiteOpenHelper { String[] columnNames = DBUtils.getColumns( db, name ); if ( null != columnNames ) { // no data means no need to copy query = String.format( "ALTER table %s RENAME TO 'temp_%s'", - name, name ); + name, name ); db.execSQL( query ); } createTable( db, name, data ); @@ -309,9 +309,19 @@ public class DBHelper extends SQLiteOpenHelper { if ( null != columnNames ) { ArrayList oldCols = new ArrayList( Arrays.asList( columnNames ) ); - String[] newColNames = DBUtils.getColumns( db, name ); - ArrayList newCols = - new ArrayList( Arrays.asList( newColNames ) ); + + // Make a list of columns in the new DB, using it to + // remove from the old list any that aren't in the + // new. Old tables may have column names we no longer + // use, but we can't try to copy them because the new + // doesn't have 'em. Note that calling getColumns() on + // the newly-created table doesn't work, perhaps + // because we're in a transaction and nothing's been + // committed. + ArrayList newCols = new ArrayList(); + for ( int ii = 0; ii < data.length; ii += 2 ) { + newCols.add( data[ii] ); + } oldCols.retainAll( newCols ); String cols = TextUtils.join( ",", oldCols ); From 20056153aa1507a153fbc0dbdaaeaea962ad3edd Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 7 Aug 2013 23:54:47 -0700 Subject: [PATCH 2/2] up version strings --- xwords4/android/XWords4/AndroidManifest.xml | 2 +- xwords4/android/XWords4/res/raw/changes | 5 +++-- xwords4/android/XWords4/res/values/app_name.xml | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/xwords4/android/XWords4/AndroidManifest.xml b/xwords4/android/XWords4/AndroidManifest.xml index aff1eb036..644834e4a 100644 --- a/xwords4/android/XWords4/AndroidManifest.xml +++ b/xwords4/android/XWords4/AndroidManifest.xml @@ -22,7 +22,7 @@ to come from a domain that you own or have control over. --> diff --git a/xwords4/android/XWords4/res/raw/changes b/xwords4/android/XWords4/res/raw/changes index f92164ed7..ce04d4a73 100644 --- a/xwords4/android/XWords4/res/raw/changes +++ b/xwords4/android/XWords4/res/raw/changes @@ -5,11 +5,12 @@ -Crosswords 4.4 beta 64 release +Crosswords 4.4 beta 65 release

New with this release

    -
  • Fix tray height on large tablets
  • +
  • Fix crash upgrading directly from two-year-old version. C'mon, + people!

Next up

diff --git a/xwords4/android/XWords4/res/values/app_name.xml b/xwords4/android/XWords4/res/values/app_name.xml index 28cd7ef25..0760f9156 100644 --- a/xwords4/android/XWords4/res/values/app_name.xml +++ b/xwords4/android/XWords4/res/values/app_name.xml @@ -1,5 +1,5 @@ - 4.4 beta 64 + 4.4 beta 65