If 3 screens are good 5 will be better
diff --git a/src/com/android/launcher2/LauncherProvider.java b/src/com/android/launcher2/LauncherProvider.java
index 9226c22..942b4be 100644
--- a/src/com/android/launcher2/LauncherProvider.java
+++ b/src/com/android/launcher2/LauncherProvider.java
@@ -58,7 +58,7 @@
private static final String DATABASE_NAME = "launcher.db";
- private static final int DATABASE_VERSION = 4;
+ private static final int DATABASE_VERSION = 5;
static final String AUTHORITY = "com.android.launcher2.settings";
@@ -393,6 +393,21 @@
}
}
+ if (version < 5) {
+ // We went from 3 to 5 screens. Move everything 1 to the right
+ db.beginTransaction();
+ try {
+ db.execSQL("UPDATE favorites SET screen=(screen + 1);");
+ db.setTransactionSuccessful();
+ version = 5;
+ } catch (SQLException ex) {
+ // Old version remains, which means we wipe old data
+ Log.e(LOG_TAG, ex.getMessage(), ex);
+ } finally {
+ db.endTransaction();
+ }
+ }
+
if (version != DATABASE_VERSION) {
Log.w(LOG_TAG, "Destroying all old data.");
db.execSQL("DROP TABLE IF EXISTS " + TABLE_FAVORITES);