Jul 9, 2010
I'm working on a android application that will display Strings to the user, and the user then has the option to add one to a favorite list. I have searched and searched and cannot find the proper way of doing this. I did get one open source project, everything worked until the user removed a favorite. The database would clear the row of data, but when a new row is added, it would behave as if the deleted row still had data, leaving blanks in the favorite list.
View 2 Replies
This is my insert method
public long insertString(String newString)
ContentValues newStringValue = new ContentValues();
return db.insert(DATABASE_TABLE, null, newStringValue);
The long returned will always increment even if i use the remove method:
public boolean removeString(long _rowIndex)
return db.delete(DATABASE_TABLE, KEY_ID + "=" + _rowIndex, null) > 0;
If I try to remove the third index, and the user removed a question at the third index, the method returns false, is there a way to completely remove all rows with no data?