Fixed bug where history wasn't being deleted until the app was restarted
This commit is contained in:
parent
119245a5fa
commit
d5e1e06d84
@ -31,7 +31,7 @@ public class HistoryDatabase extends SQLiteOpenHelper {
|
||||
private static final String KEY_TITLE = "title";
|
||||
private static final String KEY_TIME_VISITED = "time";
|
||||
|
||||
private static SQLiteDatabase mDatabase;
|
||||
private SQLiteDatabase mDatabase;
|
||||
|
||||
private static HistoryDatabase mInstance;
|
||||
|
||||
@ -65,6 +65,12 @@ public class HistoryDatabase extends SQLiteOpenHelper {
|
||||
onCreate(db);
|
||||
}
|
||||
|
||||
public void deleteHistory() {
|
||||
mDatabase.delete(TABLE_HISTORY, null, null);
|
||||
mDatabase.close();
|
||||
mDatabase = this.getWritableDatabase();
|
||||
}
|
||||
|
||||
public boolean isClosed() {
|
||||
return mDatabase == null || !mDatabase.isOpen();
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ public class WebUtils {
|
||||
}
|
||||
|
||||
public static void clearHistory(@NonNull Context context, boolean systemBrowserPresent) {
|
||||
context.deleteDatabase(HistoryDatabase.DATABASE_NAME);
|
||||
HistoryDatabase.getInstance(context).deleteHistory();
|
||||
WebViewDatabase m = WebViewDatabase.getInstance(context);
|
||||
m.clearFormData();
|
||||
m.clearHttpAuthUsernamePassword();
|
||||
|
Loading…
Reference in New Issue
Block a user