Java 类android.webkit.WebViewDatabase 实例源码
项目:browser
文件:BrowserActivity.java
@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);
}
项目:youkes_browser
文件:BrowserActivity.java
@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);
}
项目:focus-android
文件:SystemWebView.java
@Override
public void cleanup() {
clearFormData();
clearHistory();
clearMatches();
clearSslPreferences();
clearCache(true);
// We don't care about the callback - we just want to make sure cookies are gone
CookieManager.getInstance().removeAllCookies(null);
WebStorage.getInstance().deleteAllData();
final WebViewDatabase webViewDatabase = WebViewDatabase.getInstance(getContext());
// It isn't entirely clear how this differs from WebView.clearFormData()
webViewDatabase.clearFormData();
webViewDatabase.clearHttpAuthUsernamePassword();
deleteContentFromKnownLocations(getContext());
}
项目:Fabric-Example-App-Android
文件:MoPubView.java
public MoPubView(Context context, AttributeSet attrs) {
super(context, attrs);
ManifestUtils.checkWebViewActivitiesDeclared(context);
mContext = context;
mScreenVisibility = getVisibility();
setHorizontalScrollBarEnabled(false);
setVerticalScrollBarEnabled(false);
// There is a rare bug in Froyo/2.2 where creation of a WebView causes a
// NullPointerException. (http://code.google.com/p/android/issues/detail?id=10789)
// It happens when the WebView can't access the local file store to make a cache file.
// Here, we'll work around it by trying to create a file store and then just go inert
// if it's not accessible.
if (WebViewDatabase.getInstance(context) == null) {
MoPubLog.e("Disabling MoPub. Local cache file is inaccessible so MoPub will " +
"fail if we try to create a WebView. Details of this Android bug found at:" +
"http://code.google.com/p/android/issues/detail?id=10789");
return;
}
mAdViewController = AdViewControllerFactory.create(context, this);
registerScreenStateBroadcastReceiver();
}
项目:morse
文件:UnileadView.java
public UnileadView(Context context, AttributeSet attrs) {
super(context, attrs);
mContext = context;
mIsInForeground = (getVisibility() == VISIBLE);
mLocationAwareness = LocationAwareness.NORMAL;
setHorizontalScrollBarEnabled(false);
setVerticalScrollBarEnabled(false);
// There is a rare bug in Froyo/2.2 where creation of a WebView causes a
// NullPointerException. (http://code.google.com/p/android/issues/detail?id=10789)
// It happens when the WebView can't access the local file store to make a cache file.
// Here, we'll work around it by trying to create a file store and then just go inert
// if it's not accessible.
if (WebViewDatabase.getInstance(context) == null) {
Logger.e("Disabling Unilead SDK. Local cache file is inaccessible so SDK will " +
"fail if we try to create a WebView. Details of this Android bug found at:" +
"http://code.google.com/p/android/issues/detail?id=10789");
return;
}
engine = Engine.Factory.create(context, this);
registerScreenStateBroadcastReceiver();
}
项目:prowebview
文件:ProWebView.java
/**
* Clear the web database
*/
public void clearDatabase() {
WebViewDatabase database = WebViewDatabase.getInstance(getContext());
database.clearHttpAuthUsernamePassword();
database.clearFormData();
database.clearUsernamePassword();
}
项目:Xndroid
文件:WebUtils.java
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);
}
项目:EsperantoRadio
文件:Kontakt_info_om_frag.java
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rod = inflater.inflate(R.layout.kontakt_info_om_frag, container, false);
String url = App.grunddata.android_json.optString("kontakt_url", "http://dr.dk");
WebView webview = (WebView) rod.findViewById(R.id.webview);
// Jacob: Fix for 'syg' webview-cache - se http://code.google.com/p/android/issues/detail?id=10789
WebViewDatabase webViewDB = WebViewDatabase.getInstance(getActivity());
if (webViewDB != null) {
// OK, webviewet kan bruge sin cache
webview.getSettings().setJavaScriptEnabled(true);
webview.loadUrl(url);
// hjælper det her??? webview.getSettings().setDatabasePath(...);
} else {
// Øv, vi viser URLen i en ekstern browser.
// Når brugeren derefter trykker 'tilbage' ser han et tomt webview.
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
}
TextView titel = (TextView) rod.findViewById(R.id.titel);
titel.setTypeface(App.skrift_gibson_fed);
TextView version = (TextView) rod.findViewById(R.id.version);
version.setTypeface(App.skrift_gibson);
version.setText(App.versionsnavn);
version.setContentDescription("\u00A0"); // SLUK for højtlæsning ... det virker ikke
rod.findViewById(R.id.kontakt).setOnClickListener(this);
return rod;
}
项目:JumpGo
文件:WebUtils.java
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);
}
项目:DeeBrowser
文件:WebUtils.java
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);
}
项目:Dashchan
文件:WebViewUtils.java
public static void clearAll(WebView webView) {
clearCookie();
if (webView != null) {
webView.clearCache(true);
}
WebViewDatabase webViewDatabase = WebViewDatabase.getInstance(MainApplication.getInstance());
webViewDatabase.clearFormData();
webViewDatabase.clearHttpAuthUsernamePassword();
WebStorage.getInstance().deleteAllData();
}
项目:JumpGo
文件:WebUtils.java
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);
}
项目:FullRobolectricTestSample
文件:ShadowWebViewDatabase.java
@Implementation
public static WebViewDatabase getInstance(Context ignored) {
return Robolectric.newInstanceOf(WebViewDatabase.class);
}
项目:FullRobolectricTestSample
文件:Robolectric.java
public static ShadowWebViewDatabase shadowOf(WebViewDatabase instance) {
return (ShadowWebViewDatabase) shadowOf_(instance);
}