我有一个汽车包,在我开始打字时,我在数据库中展示了两栏的内容。
如今,I wanna 渗入该物质。
public Cursor runQueryOnBackgroundThread(CharSequence constraint) {
if (getFilterQueryProvider() != null) { return getFilterQueryProvider().runQuery(constraint); }
String filter="";
if(constraint==null) filter="";
else filter=constraint.toString();
Cursor cursor=db.getCursor(filter);
return cursor;
}
我的班子操纵数据库的方法就是这样:
public Cursor getCursor(String prefix) {
SQLiteQueryBuilder queryBuilder = new SQLiteQueryBuilder();
String[] args = {prefix};
queryBuilder.setTables(TABLE_2);
String[] asColumnsToReturn = new String[] {"route","user_id"};
Cursor mCursor = queryBuilder.query(db,asColumnsToReturn,null, args, null, null,null);
int idcol = mCursor.getColumnIndexOrThrow(KEY_ROUTE);
int kwcol = mCursor.getColumnIndexOrThrow(KEY_USER_ID );
while(mCursor.moveToNext()) {
String id = mCursor.getString(idcol);
String kw = mCursor.getString(kwcol);
Log.d(id,kw);
}
return mCursor;
}
问题:我没有在我的汽车中展示什么?
这就是我的标志如何看待:
05-01 09:28:59.207: WARN/Filter(366): An exception occured during performFiltering()!
05-01 09:28:59.207: WARN/Filter(366): android.database.sqlite.SQLiteException: bind or column index out of range: handle 0x3114b8
05-01 09:28:59.207: WARN/Filter(366): at android.database.sqlite.SQLiteProgram.native_bind_string(Native Method)
05-01 09:28:59.207: WARN/Filter(366): at android.database.sqlite.SQLiteProgram.bindString(SQLiteProgram.java:178)
05-01 09:28:59.207: WARN/Filter(366): at android.database.sqlite.SQLiteQuery.bindString(SQLiteQuery.java:190)
05-01 09:28:59.207: WARN/Filter(366): at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:55)
05-01 09:28:59.207: WARN/Filter(366): at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1220)
05-01 09:28:59.207: WARN/Filter(366): at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:316)
05-01 09:28:59.207: WARN/Filter(366): at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:266)
05-01 09:28:59.207: WARN/Filter(366): at com.server.DBAdapter.getCursor(DBAdapter.java:199)
05-01 09:28:59.207: WARN/Filter(366): at com.server.Server8$ContactListCursorAdapter.runQueryOnBackgroundThread(Server8.java:185)
05-01 09:28:59.207: WARN/Filter(366): at android.widget.CursorFilter.performFiltering(CursorFilter.java:49)
05-01 09:28:59.207: WARN/Filter(366): at android.widget.Filter$RequestHandler.handleMessage(Filter.java:234)
05-01 09:28:59.207: WARN/Filter(366): at
android.os.Handler.dispatchMessage(Handler.java:99)
05-01 09:28:59.207: WARN/Filter(366): at android.os.Looper.loop(Looper.java:123)
05-01 09:28:59.207: WARN/Filter(366): at
android.os.HandlerThread.run(HandlerThread.java:60)