Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图找到一种更新表格行中字段的方法,同时保持行 ID(由 Active Android 自动生成)相同。这在 Active Android 中是否可行,或者当特定行发生更新时,行 ID 是否总是会更新?
您可以尝试获取您的对象:
Object obj = new Select().from(YourClass.class).where("id = ?", id).executeSingle();
(您可以使用您知道的字段之一更改“id”)
然后,更新您要更新的字段:
obj.setName("Foo");
最后,保存更新:
obj.save();
我在使用其他方式重复条目时遇到了问题,但这对我有用。