]> hydra-www.ietfng.org Git - android-vcpass-oisafe/commitdiff
Fix bug where item gets created twice when user hits "save" since the
authorisaac.jones <isaac.jones@72b678ce-9140-0410-bee8-679b907dd61a>
Sun, 18 Jan 2009 01:01:39 +0000 (01:01 +0000)
committerisaac.jones <isaac.jones@72b678ce-9140-0410-bee8-679b907dd61a>
Sun, 18 Jan 2009 01:01:39 +0000 (01:01 +0000)
item is saved during onPause as well as saved. Repaired by setting the
row id when adding the password for the first time since this prevents
the 2nd time around from adding it again.

git-svn-id: http://openintents.googlecode.com/svn/trunk/Safe@1759 72b678ce-9140-0410-bee8-679b907dd61a

src/org/openintents/safe/PassEdit.java

index 3f1df13d52f57cd9c13b34b4bfbc55dacaed7b34..58cf7f54c26955ac399563bdbb1a3929b43e9661 100644 (file)
@@ -185,7 +185,7 @@ public class PassEdit extends Activity {
                }
 
                if (RowId == null || RowId == -1) {
-                       dbHelper.addPassword(entry);
+                       RowId = dbHelper.addPassword(entry);
                } else {
                        PassEntry storedEntry = dbHelper.fetchPassword (RowId);
                        //update fields that aren't set in the UI: