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_TITLE = "title";
|
||||||
private static final String KEY_TIME_VISITED = "time";
|
private static final String KEY_TIME_VISITED = "time";
|
||||||
|
|
||||||
private static SQLiteDatabase mDatabase;
|
private SQLiteDatabase mDatabase;
|
||||||
|
|
||||||
private static HistoryDatabase mInstance;
|
private static HistoryDatabase mInstance;
|
||||||
|
|
||||||
@ -65,6 +65,12 @@ public class HistoryDatabase extends SQLiteOpenHelper {
|
|||||||
onCreate(db);
|
onCreate(db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void deleteHistory() {
|
||||||
|
mDatabase.delete(TABLE_HISTORY, null, null);
|
||||||
|
mDatabase.close();
|
||||||
|
mDatabase = this.getWritableDatabase();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isClosed() {
|
public boolean isClosed() {
|
||||||
return mDatabase == null || !mDatabase.isOpen();
|
return mDatabase == null || !mDatabase.isOpen();
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ public class WebUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void clearHistory(@NonNull Context context, boolean systemBrowserPresent) {
|
public static void clearHistory(@NonNull Context context, boolean systemBrowserPresent) {
|
||||||
context.deleteDatabase(HistoryDatabase.DATABASE_NAME);
|
HistoryDatabase.getInstance(context).deleteHistory();
|
||||||
WebViewDatabase m = WebViewDatabase.getInstance(context);
|
WebViewDatabase m = WebViewDatabase.getInstance(context);
|
||||||
m.clearFormData();
|
m.clearFormData();
|
||||||
m.clearHttpAuthUsernamePassword();
|
m.clearHttpAuthUsernamePassword();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user