0

I am trying to find a method of updating fields in a table row whilst leaving the row id (automatically generated by Active Android) the same. Is this possible in Active Android or does the row id always get updated when updates occur to a particular row?

Gaurav
  • 69
  • 1
  • 6
user2252028
  • 31
  • 1
  • 3

1 Answers1

0

What you can try is fetching your object:

Object obj = new Select().from(YourClass.class).where("id = ?", id).executeSingle();

(you can change 'id' with one of the fields you know)

Then, update the field you want to update:

obj.setName("Foo");

Finally, save the update:

obj.save();

I had problems with duplicated entries with others ways, but this one works for me.

Quentin S.
  • 1,462
  • 20
  • 18