本文整理汇总了Java中android.webkit.WebIconDatabase类的典型用法代码示例。如果您正苦于以下问题:Java WebIconDatabase类的具体用法?Java WebIconDatabase怎么用?Java WebIconDatabase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WebIconDatabase类属于android.webkit包,在下文中一共展示了WebIconDatabase类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clearHistory
import android.webkit.WebIconDatabase; //导入依赖的package包/类
@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);
}
示例2: onPageFinished
import android.webkit.WebIconDatabase; //导入依赖的package包/类
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();
}
}
示例3: clearHistory
import android.webkit.WebIconDatabase; //导入依赖的package包/类
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);
}
示例4: clearHistory
import android.webkit.WebIconDatabase; //导入依赖的package包/类
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);
}
示例5: onCreate
import android.webkit.WebIconDatabase; //导入依赖的package包/类
@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());
}
}
示例6: onDestroy
import android.webkit.WebIconDatabase; //导入依赖的package包/类
@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();
}
示例7: onCreate
import android.webkit.WebIconDatabase; //导入依赖的package包/类
@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());
}
}
示例8: onDestroy
import android.webkit.WebIconDatabase; //导入依赖的package包/类
@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();
}
示例9: onPageFinished
import android.webkit.WebIconDatabase; //导入依赖的package包/类
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();
}
}
示例10: onCreate
import android.webkit.WebIconDatabase; //导入依赖的package包/类
@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());
}
}
示例11: initializeWebIconDatabase
import android.webkit.WebIconDatabase; //导入依赖的package包/类
/**
* Initialize the Web icons database.
*/
private void initializeWebIconDatabase() {
final WebIconDatabase db = WebIconDatabase.getInstance();
db.open(getDir("icons", 0).getPath());
}
示例12: initializeWebIconDatabase
import android.webkit.WebIconDatabase; //导入依赖的package包/类
/**
* Initialize the Web icons database.
*/
private void initializeWebIconDatabase() {
final WebIconDatabase db = WebIconDatabase.getInstance();
db.open(getDir("icons", 0).getPath());
}