From 5e9767e2b532d6786b7c039b6a32419f31be1289 Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Thu, 13 May 2010 11:41:51 +0200 Subject: [PATCH] Solve crash on creating groups --- src/com/openwide/android/ContactRow.java | 1 - src/com/openwide/android/GroupEditActivity.java | 2 -- src/com/openwide/android/GroupsDbAdapter.java | 13 +++++++------ src/com/openwide/android/MultiSmsSender.java | 4 ---- src/com/openwide/android/PhoneNumberSelection.java | 1 - 5 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/com/openwide/android/ContactRow.java b/src/com/openwide/android/ContactRow.java index c43b81f..6a55405 100644 --- a/src/com/openwide/android/ContactRow.java +++ b/src/com/openwide/android/ContactRow.java @@ -44,7 +44,6 @@ public class ContactRow extends LinearLayout { this.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { mSelectedCheckBox.performClick(); diff --git a/src/com/openwide/android/GroupEditActivity.java b/src/com/openwide/android/GroupEditActivity.java index 09d25c5..dbf2417 100644 --- a/src/com/openwide/android/GroupEditActivity.java +++ b/src/com/openwide/android/GroupEditActivity.java @@ -67,7 +67,6 @@ public class GroupEditActivity extends ListActivity { Button ok = (Button) findViewById(R.id.okGroups); ok.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { createGroup(); reNameGroup(); @@ -156,7 +155,6 @@ public class GroupEditActivity extends ListActivity { } - @Override public void onClick(View v) { CheckBox cBox = (CheckBox)v; createGroup(); diff --git a/src/com/openwide/android/GroupsDbAdapter.java b/src/com/openwide/android/GroupsDbAdapter.java index 4a72982..f27d2b0 100755 --- a/src/com/openwide/android/GroupsDbAdapter.java +++ b/src/com/openwide/android/GroupsDbAdapter.java @@ -42,7 +42,7 @@ public class GroupsDbAdapter { public static final String KEY_GROUP_TO_PHONE_PHONEID = "pid"; private static final String TAG = "groupsDbAdapter"; - private DatabaseHelper mDbHelper; + private GroupDbHelper mDbHelper; private SQLiteDatabase mDb; /** @@ -56,16 +56,16 @@ public class GroupsDbAdapter { "create table group_TO_PHONE (_id integer primary key autoincrement, " + "gid integer not null, pid integer not null);"; - private static final String DATABASE_NAME = "data"; + private static final String DATABASE_NAME = "dataGroup"; private static final String DATABASE_GROUP_TABLE = "groups"; private static final String DATABASE_GROUP_TO_PHONE_TABLE = "group_TO_PHONE"; - private static final int DATABASE_VERSION = 3; + private static final int DATABASE_VERSION = 4; private final Context mCtx; - private static class DatabaseHelper extends SQLiteOpenHelper { + private static class GroupDbHelper extends SQLiteOpenHelper { - DatabaseHelper(Context context) { + GroupDbHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } @@ -107,8 +107,9 @@ public class GroupsDbAdapter { * @throws SQLException if the database could be neither opened or created */ public GroupsDbAdapter open() throws SQLException { - mDbHelper = new DatabaseHelper(mCtx); + mDbHelper = new GroupDbHelper(mCtx); mDb = mDbHelper.getWritableDatabase(); + return this; } diff --git a/src/com/openwide/android/MultiSmsSender.java b/src/com/openwide/android/MultiSmsSender.java index 0631ac7..3bd8ccc 100644 --- a/src/com/openwide/android/MultiSmsSender.java +++ b/src/com/openwide/android/MultiSmsSender.java @@ -66,7 +66,6 @@ public class MultiSmsSender extends Activity { mAddButton.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { selectNumbers(); } @@ -74,7 +73,6 @@ public class MultiSmsSender extends Activity { mSend.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { sendMessage(); @@ -161,7 +159,6 @@ public class MultiSmsSender extends Activity { getResources().getString(R.string.ok), new DialogInterface.OnClickListener() { - @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); @@ -175,7 +172,6 @@ public class MultiSmsSender extends Activity { getResources().getString(R.string.ok), new DialogInterface.OnClickListener() { - @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); diff --git a/src/com/openwide/android/PhoneNumberSelection.java b/src/com/openwide/android/PhoneNumberSelection.java index d3b20f0..eee9404 100644 --- a/src/com/openwide/android/PhoneNumberSelection.java +++ b/src/com/openwide/android/PhoneNumberSelection.java @@ -50,7 +50,6 @@ public class PhoneNumberSelection extends ListActivity Button ok = (Button) findViewById(R.id.okContacts); ok.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { Intent i = new Intent(); String [] numbers = new String[mSelectedSet.size()];