Hi, All..
I have ChatApp.
All message save in local database.
When user press button "Log out" i need clear data about chats and contacts from DB.
I am clearing my shared_prefs(Log Out) and call clearMethod():
When i try login - i see all my previous chats(DB si CLEAR).
When i call Settings > Manage Applications> Menu button > Filter by Running. > Select Myapplication > Force stop
and try login - all OK - chatlist is clear!
How to correct clear database?
Calling Force stop - is very hard way ((
I have ChatApp.
All message save in local database.
When user press button "Log out" i need clear data about chats and contacts from DB.
I am clearing my shared_prefs(Log Out) and call clearMethod():
Code:
public void onClear(SQLiteDatabase db) {
db.execSQL("DROP TABLE IF EXISTS " + Contact.TABLE_NAME);
db.execSQL("DROP TABLE IF EXISTS " + ChatSessions.TABLE_NAME);
db.execSQL("DROP TABLE IF EXISTS " + ChatSessions.FK_TABLE_NAME);
db.execSQL("DROP TABLE IF EXISTS " + Message.TABLE_NAME);
onCreate(db);
}
When i call Settings > Manage Applications> Menu button > Filter by Running. > Select Myapplication > Force stop
and try login - all OK - chatlist is clear!
How to correct clear database?
Calling Force stop - is very hard way ((