开发者

Android: Text primary key with different name

I have an existing Windows app for which I'm writing an Android port. The app uses a unique string as the primary key, but the SQLite methods in Android all seem to work with integers and a column names _id, whereas my ID column isn't called this. Is there a way to let Android know I have a key with a different column开发者_如何学C name?


Is there a way to let Android know I have a key with a different column name?

No.

So long as you avoid the use of CursorAdapter, I think you will be OK. Otherwise, you will need to create a separate unique _ID integer column. You don't necessarily need to use that as a primary key, but CursorAdapter and friends will want it.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜