android.webkit.WebIconDatabase Java Examples

The following examples show how to use android.webkit.WebIconDatabase. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BrowserActivity.java    From browser with GNU General Public License v2.0 6 votes vote down vote up
@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);
}
 
Example #2
Source File: WebUtils.java    From Xndroid with GNU General Public License v3.0 5 votes vote down vote up
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);
}
 
Example #3
Source File: WebUtils.java    From JumpGo with Mozilla Public License 2.0 5 votes vote down vote up
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);
}
 
Example #4
Source File: BrowserWebFragment.java    From iBeebo with GNU General Public License v3.0 5 votes vote down vote up
@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());
    }
}
 
Example #5
Source File: BrowserWebFragment.java    From iBeebo with GNU General Public License v3.0 5 votes vote down vote up
@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());
    }
}
 
Example #6
Source File: Browser.java    From android_9.0.0_r45 with Apache License 2.0 2 votes vote down vote up
/**
 *  Request all icons from the database.  This call must either be called
 *  in the main thread or have had Looper.prepare() invoked in the calling
 *  thread.
 *
 *  @param  cr The ContentResolver used to access the database.
 *  @param  where Clause to be used to limit the query from the database.
 *          Must be an allowable string to be passed into a database query.
 *  @param  listener IconListener that gets the icons once they are
 *          retrieved.
 *  @removed
 */
public static final void requestAllIcons(ContentResolver cr, String where,
        WebIconDatabase.IconListener listener) {
    // Do nothing: this is no longer used.
}