小编and*_*bee的帖子

以编程方式清除浏览器缓存/历史记

在我的活动期间,我向浏览器发送意图以显示网页:


    Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("http://ww.mywebpage.com");
    startActivity(i);
Run Code Online (Sandbox Code Playgroud)

我需要确保在发送意图之前清除浏览器缓存和历史记录,以便从服务器直接加载页面,而不是从手机加载.

到目前为止,我发现了以下2个,但我不确定它们是否正确使用:


    Browser.clearHistory(getContentResolver());
    Browser.clearSearches(getContentResolver());
Run Code Online (Sandbox Code Playgroud)

也没有清除该缓存.

你知道怎么做吗 ?

android

1
推荐指数
1
解决办法
7245
查看次数

标签 统计

android ×1