OK, let's close this issue. The problem is, the SQLiteDatabaseBuilder.query can not return and just stuck there. The reason is, it can not find a projection mapping of the column "TABLE._ID" in the TABLE.ProjectionMap which is given into the qb.setProjectionMap method. The solution is, remember to add ProjectionMap.put(_ID, _ID); in your class "class TABLE extends BaseColumns" even if the column is extended from "BaseColumns". You may think its a default column and it should be added automatically into, in fact, not.
ISSUE CLOSED Although no one provides any information, still thanks all Android developers. Sincerely, On 2月13日, 上午11時04分, yukinoba <[email protected]> wrote: > More information: > > The "_id" column brings no trouble as an ORDER BY argument, but can > not exist in the projection map. The reason is still unknown. > > Needs help, please. > > Sincerely, > Nicholas > > On 2月13日, 上午10時32分, yukinoba <[email protected]> wrote: > > > To dear all, > > > I found that when you use "_id" column as the projection map and the > > order-by value, the query will stuck and never return. However, there > > has another problem still blocks me to return back from the query > > method. > > > Please, I need more information and help. > > > Sincerely, > > Nicholas > > > On 2月12日, 下午4時15分, yukinoba <[email protected]> wrote: > > > > Hi all, > > > > More information found: > > > The database could be written by the execSQL method, however, it could > > > not be read from the query method. > > > > A "Write-Only" database? that's weird... > > > > I open my database with SQLiteDatabaseHelper and SQLiteDatabase as > > > below: > > > > mDbHelper = new DatabaseHelper(mCtx); > > > mDb = mDbHelper.getWritableDatabase(); > > > > Is it possible that the read-access is "locked" by the first database? > > > I'm sure that I close my database with mDbHelper.close() after each > > > query... > > > > On 2月12日, 下午4時00分, yukinoba <[email protected]> wrote: > > > > > to dear all, > > > > > I just found a same open problem as the one I > > > > met:http://groups.google.com/group/android-developers/browse_thread/threa... > > > > > Hope this could help > > > > > Any suggestions and ideas are welcome, Plz :-) > > > > > Best regards, > > > > Nicholas > > > > > On 2月12日, 下午2時49分, yukinoba <[email protected]> wrote: > > > > > > I have a new question for this: > > > > > > Can there have multiple databases created in the same application or > > > > > service? > > > > > I have 2 databases, one for query and store the information about > > > > > phone numbers, and one for the names. > > > > > However, the ealier one works fine, and the later one stucks in the > > > > > method and never get rid of that status. > > > > > > So, my question is, does each application / service have been limited > > > > > to have only one single database? > > > > > > Plz provides any help or suggestion > > > > > > Best regards, > > > > > Nicholas > > > > > > On 2月12日, 上午9時23分, yukinoba <[email protected]> wrote: > > > > > > > Could someone give a little bit information about any possible > > > > > > solution or hint? > > > > > > I have searched in this forum and nothing about this topic :-( > > > > > > > On 2月11日, 下午6時44分, yukinoba <[email protected]> wrote: > > > > > > > > More information: > > > > > > > > Most of the data (surname) here are utf-8 encoded, does this > > > > > > > cause the > > > > > > > error? > > > > > > > Could anyone tell me how to push an utf-8 String in the SQL > > > > > > > statement? > > > > > > > > Thanks for any help! :-) > > > > > > > > Best regards, > > > > > > > Nicholas > > > > > > > > On 2月11日, 下午5時18分, yukinoba <[email protected]> wrote: > > > > > > > > > to dear all Android developers, > > > > > > > > > I'm dealing with database operation on Android recently. > > > > > > > > However, there has a problem troubles me that the query method > > > > > > > > in > > > > > > > > SQLiteQueryBuilder infinitely loops and has no return. > > > > > > > > > The operation code is like below: > > > > > > > > > //------------ CODE section --// > > > > > > > > SQLiteQueryBuilder qb = new SQLiteQueryBuilder(); > > > > > > > > > qb.setTables(TABLE.NAME); > > > > > > > > qb.setProjectionMap(TABLE.ProjectionMap); > > > > > > > > qb.appendWhere(TABLE._ID + "=" + id + " AND " > > > > > > > > + TABLE.SURNAME + "='" + surname + "'"); > > > > > > > > > String orderBy = TABLE._ID + " ASC"; > > > > > > > > String[] projection = new String[] { > > > > > > > > TABLE._ID > > > > > > > > > }; > > > > > > > > > mDbHelper = new DatabaseHelper(mCtx); > > > > > > > > mDb = mDbHelper.getWritableDatabase(); > > > > > > > > > Cursor c = qb.query(mDb, projection, null, null, null, null, > > > > > > > > orderBy); > > > > > > > > //------------ CODE section --// > > > > > > > > > However, it stuck in the query and never return back, and there > > > > > > > > has > > > > > > > > neither exceptions nor any error messages from the LogCat. Does > > > > > > > > there > > > > > > > > any mistake I make in my code? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

