自动增量激活的Andr​​oid [英] Auto increment in active android

查看:273
本文介绍了自动增量激活的Andr​​oid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

这篇关于自动增量激活的Andr​​oid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆