Found it! I asked for a saved preference which hadn't been loaded yet! Thanks a lot for your time and help Kostya!
On Oct 4, 4:46 pm, Kostya Vasilyev <[email protected]> wrote: > The exception comes later: > > package.Tabs.checkListName(DbAdapter.java:310 > > > > > ... calls db.query() passing a null value in the list of query arguments > > (the new String[] { ... arg1, arg2 ... } part). > > -- Kostya > > 2011/10/4 André <[email protected]> > > > > > > > > > I still can't figure it out! > > > This is what I use in my main activity to open the db. > > > @Override > > public void onCreate(Bundle savedInstanceState) { > > super.onCreate(savedInstanceState); > > setContentView(R.layout.main); > > > db = new DbAdapter open(this); > > db.open(); > > > Which calls: > > > public DbAdapter open() throws SQLException { > > mDbHelper = new DatabaseHelper(mCtx); > > mDb = mDbHelper.getReadableDatabase(); > > return this; > > } > > > Any ideas of how it could skip this step? > > > On Oct 4, 4:12 pm, Kostya Vasilyev <[email protected]> wrote: > > > According to stack trace, your code gets past opening the database. > > > > And then: > > > > package.Tabs.checkListName(DbAdapter.java:310 > > > > ... calls db.query() passing a null value in the list of query arguments > > > (the new String[] { ... arg1, arg2 ... } part). > > > > This is not allowed, and causes the exception inside Andorid's database > > > classes. > > > > -- Kostya > > > > 04.10.2011 17:40, André пишет: > > > > > 15:02:28.791: ERROR/AndroidRuntime(8904): Caused by: > > > > java.lang.IllegalArgumentException: the bind value at index 1 is null > > > > > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at > > > > android.database.sqlite.SQLiteProgram.bindString(SQLiteProgram.java: > > > > 237) > > > > > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at > > > > android.database.sqlite.SQLiteQuery.bindString(SQLiteQuery.java:185) > > > > > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at > > > android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDr > > iver.java: > > > > 59) > > > > > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at > > > android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.j > > ava: > > > > 1438) > > > > > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at > > > android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java > > : > > > > 1317) > > > > > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at > > > > android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1271) > > > > > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at > > > > android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1391) > > > > > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at > > > > package.Tabs.checkListName(DbAdapter.java:310) > > > > > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at > > > > package.Main.getListId(Main.java:567) > > > > > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at > > > > package.Main.fillItems(Main.java:191) > > > > -- > > > Kostya Vasilyev > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected] > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

