@SuppressWarnings("deprecation") public void clearHistory() { this.deleteDatabase(HistoryDatabase.DATABASE_NAME); WebViewDatabase m = WebViewDatabase.getInstance(this); m.clearFormData(); m.clearHttpAuthUsernamePassword(); if (API < 18) { m.clearUsernamePassword(); WebIconDatabase.getInstance().removeAllIcons(); } if (mSystemBrowser) { try { //Browser. //Browser.clearHistory(getContentResolver()); } catch (NullPointerException ignored) { } } Utils.trimCache(this); }
public void onPageFinished(String url) { updateUI(); if (url.contains("mobile.twitter.com")) { mCurrentWebView.loadUrl("http://dabr.co.uk/"); return; } if ((Controller.getInstance().getPreferences().getBoolean( Constants.PREFERENCES_ADBLOCKER_ENABLE, true)) && (!checkInAdBlockWhiteList(mCurrentWebView.getUrl()))) { mCurrentWebView.loadAdSweep(); } WebIconDatabase.getInstance().retainIconForPageUrl(mCurrentWebView.getUrl()); if (mUrlBarVisible) { startToolbarsHideRunnable(); } }
public static void clearHistory(@NonNull Context context, @NonNull HistoryModel historyModel) { historyModel.deleteHistory() .subscribeOn(Schedulers.io()) .subscribe(); WebViewDatabase m = WebViewDatabase.getInstance(context); m.clearFormData(); m.clearHttpAuthUsernamePassword(); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) { //noinspection deprecation m.clearUsernamePassword(); //noinspection deprecation WebIconDatabase.getInstance().removeAllIcons(); } Utils.trimCache(context); }
public static void clearHistory(@NonNull Context context) { HistoryDatabase.getInstance().deleteHistory(); WebViewDatabase m = WebViewDatabase.getInstance(context); m.clearFormData(); m.clearHttpAuthUsernamePassword(); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) { //noinspection deprecation m.clearUsernamePassword(); //noinspection deprecation WebIconDatabase.getInstance().removeAllIcons(); } Utils.trimCache(context); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); setRetainInstance(true); /** * some devices for example Nexus 7 4.2.2 version will receive website * favicon, but some devices may cant, Galaxy Nexus 4.2.2 version */ String path = FileManager.getWebViewFaviconDirPath(); if (!TextUtils.isEmpty(path)) { WebIconDatabase.getInstance().open(FileManager.getWebViewFaviconDirPath()); } }
@Override protected void onDestroy() { WebIconDatabase.getInstance().close(); if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean( Constants.PREFERENCES_PRIVACY_CLEAR_CACHE_ON_EXIT, false)) { mCurrentWebView.clearCache(true); } EventController.getInstance().removeDownloadListener(this); super.onDestroy(); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); setRetainInstance(true); /** * some devices for example Nexus 7 4.2.2 version will receive website favicon, but some * devices may cant, Galaxy Nexus 4.2.2 version */ String path = FileManager.getWebViewFaviconDirPath(); if (!TextUtils.isEmpty(path)) { WebIconDatabase.getInstance().open(FileManager.getWebViewFaviconDirPath()); } }
@Override protected void onDestroy() { WebIconDatabase.getInstance().close(); if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean(Constants.PREFERENCES_PRIVACY_CLEAR_CACHE_ON_EXIT, false)) { mCurrentWebView.clearCache(true); } EventController.getInstance().removeDownloadListener(this); PreferenceManager.getDefaultSharedPreferences(this).unregisterOnSharedPreferenceChangeListener(mPreferenceChangeListener); super.onDestroy(); }
public void onPageFinished(String url) { updateUI(); if ((Controller.getInstance().getPreferences().getBoolean(Constants.PREFERENCES_ADBLOCKER_ENABLE, true)) && (!checkInAdBlockWhiteList(mCurrentWebView.getUrl()))) { mCurrentWebView.loadAdSweep(); } WebIconDatabase.getInstance().retainIconForPageUrl(mCurrentWebView.getUrl()); if (mUrlBarVisible) { startToolbarsHideRunnable(); } }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); setRetainInstance(true); /** *some devices for example Nexus 7 4.2.2 version will receive website favicon, but some * devices may cant, Galaxy Nexus 4.2.2 version */ String path = FileManager.getWebViewFaviconDirPath(); if (!TextUtils.isEmpty(path)) { WebIconDatabase.getInstance().open(FileManager.getWebViewFaviconDirPath()); } }
/** * Initialize the Web icons database. */ private void initializeWebIconDatabase() { final WebIconDatabase db = WebIconDatabase.getInstance(); db.open(getDir("icons", 0).getPath()); }