How to Delete All Items From SQLite in Android?

Your delete() call is correct. Did you get writable database? Here is example of method using delete: Remove all users and groups from database.

*/ public void removeAll() { // db. Delete(String tableName, String whereClause, String whereArgs); // If whereClause is null, it will delete all rows. SQLiteDatabase db = helper.

GetWritableDatabase(); // helper is object extends SQLiteOpenHelper db. Delete(DatabaseHelper. TAB_USERS, null, null); db.

Delete(DatabaseHelper. TAB_USERS_GROUP, null, null); }.

Your delete() call is correct. Did you get writable database? Here is example of method using delete: /** * Remove all users and groups from database.

*/ public void removeAll() { // db. Delete(String tableName, String whereClause, String whereArgs); // If whereClause is null, it will delete all rows. SQLiteDatabase db = helper.

GetWritableDatabase(); // helper is object extends SQLiteOpenHelper db. Delete(DatabaseHelper. TAB_USERS, null, null); db.

Delete(DatabaseHelper. TAB_USERS_GROUP, null, null); }.

Yes, I did use getWritableDatabase(). – Cg2916 Apr 16 at 17:53.

If you just want to delete one table then try... db. ExecSQL("DROP TABLE " + TABLE_NAME).

I don't want to delete the table, just the items in the table. – Cg2916 Apr 16 at 17:53.

How to Delete All Items From SQLite in Android - Stack Overflow.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions