开发者

Aliasing _id in an FTS3 database

开发者 https://www.devze.com 2023-03-05 01:02 出处:网络
My application uses an SQLite database with FTS3. 开发者_StackOverflowThe results of a query shall be displayed in a list view using a SimpleCursorAdapter. However I get the following exception:

My application uses an SQLite database with FTS3. 开发者_StackOverflowThe results of a query shall be displayed in a list view using a SimpleCursorAdapter. However I get the following exception:

java.lang.IllegalArgumentException: column '_id' does not exist

Doing some search I found this answer: Android Full Text Search and ListAdapter. I get the point but I can't figure out how to create this alias for docid -> _id. The SearchableDictionary example on the Android pages are not that helpful for me ;-)

Cheers,

Robert


You'll need to do a 'raw' query such as...

cursor = db.rawQuery("SELECT docid as _id,...");
0

精彩评论

暂无评论...
验证码 换一张
取 消