programmatically erase android browser cache, history, etc. with root

点点圈 提交于 2019-12-04 16:47:56

how about something as simple as

adb shell pm clear com.android.browser 

from command line ?

This API is deprecated in Android Marshmallow. If you build using API 23 it wont work any more.

You can delete them @micahhoover, You can delete complete com.android.browser sub directories, every time you relaunch browser, all the sub folders gets created.

To delete android browser History(Default)

in your Activity.java file add the follwing code

Browser.clearHistory(getContentResolver());

In your manifest add

<uses-permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"/>
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!