Android以编程方式删除Chrome /默认浏览器Cookie,历史记录,搜索 [英] Android programmatically delete Chrome / default browser cookies, history, searches
本文介绍了Android以编程方式删除Chrome /默认浏览器Cookie,历史记录,搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
谢谢!
解决方案
在 Activity
或 Service
,添加
ContentResolver cR = getContentResolver ;
if(Browser.canClearHistory(cR)){
Browser.clearHistory(cR);
Browser.clearSearches(cR);
其中浏览器
是 android.provider.Browser
类。
这将清除默认浏览器的历史记录。
Like the title. I want to delete cookie, cache of browser of Android by coding in my application. (browser not webview) Thank you!
解决方案
In your Activity
or Service
, add
ContentResolver cR = getContentResolver();
if(Browser.canClearHistory(cR)){
Browser.clearHistory(cR);
Browser.clearSearches(cR);
}
where Browser
is the android.provider.Browser
class.
This will clear the default browser's history.
这篇关于Android以编程方式删除Chrome /默认浏览器Cookie,历史记录,搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文