自动增量激活的Andr​​oid增量、Andr、oid

2023-09-04 03:07:38 作者:我还在

我试图用积极的机器人,我有一个关于我怎么能实现在一个表中的自动递增字段疑问?

I tried to use active android, i have a doubt about how could i achieve a auto-increment field in a table?

在他们的文件,他们已经提供了code这样

In their documentation they have provided a code like this

Item item = new Item();
item.remoteId = 1;
item.category = restaurants;
item.name = "Outback Steakhouse";
item.save();

我们可以使remoteId场自动递增?

Can we make the remoteId field auto-increment?

推荐答案

在SQLite的,你应该使用自动增量的标签在创建表:的 http://www.sqlite.org/autoinc.html

In sqlite you should use Autoincrement tag in create table: http://www.sqlite.org/autoinc.html

在其他情况下,使用以获得更多信息preV(),GETNEXT()等。

In other cases use methods like getPrev(), getNext(), etc.