
I hope this will help someone who encounters the same problem, so he doesn’t have to search for a solution as long as I had to.

So a quick fix for this problem is to simply don’t use the getColumnIndex() method from the cursor, but instead just access it by its id (Though you have to remember to change this part of the code if you make changes to your table rows). SQLiteQueryBuilder qb new SQLiteQueryBuilder() qb.setStrict(true) Defines methods that all servlets must implement. on android 2.1, index is returned as -1Īfter some research I found out that this apparently happens, when using distinct with the QueryBuilder on android 2.1.

SQLiteDatabase db = helper.getReadableDatabase() SQLiteQueryBuilder builder = new SQLiteQueryBuilder() Here’s the simplified code: //member, a SQLiteOpenHelper The following java examples will help you to understand the usage of .These source code samples are taken from different open source projects. On later versions, my code worked perfectly, but on 2.1 it crashed every time when trying to get a column from a cursor.

Before you invoke query, you may want to set some arguments to the SQLiteQueryBuilder, like set which table(s) you want to query from by using setTables method, append criteria by using. You can use SQLiteQueryBuilder's query method to get the query result. In a recent project I encountered a problem with SQLite on android 2.1. SQLiteQueryBuilder is used to build query string using the args you passed in.
