以编程方式清除Android地图历史记录
我想以编程方式清除android地图(和导航)应用程序的历史记录.
I want to programmatically clear the history of the android maps (and navigation) application.
我知道有一种清除浏览器历史记录的方法,
I know there is a way to clear the browser history via
Browser.clearSearches(getContentResolver());
以及相应的权限:com.android.browser.permission.WRITE_HISTORY_BOOKMARKS
并且可以正常运行(2.2.).
and the corresponding permission: com.android.browser.permission.WRITE_HISTORY_BOOKMARKS
and this works fine (2.2.).
我找不到清除地图历史记录的任何方法. 在线清除Google/历史记录也无济于事.
I couldn't find any way to clear the Maps-History though. Clearing the google/history online doesn't help either.
市场上有一些应用促进了这一点,因此必须有一个API,但是我真的找不到它.
There are some apps in the market that promote to do that, so there must be an API for it, but i really couldn't find it yet.
我也对CLEAR_APP_CACHE和CLEAR_APP_USER_DATA感到有些困惑,但似乎它们是仅具有签名/root用户权限的,并且无论如何都要过度使用.
I also messed around a bit with CLEAR_APP_CACHE and CLEAR_APP_USER_DATA but seems like they are signed/root-only permissions and delte too much anyways.
得到aClean开发人员Richard的答复:
Got a reply from Richard, developer of aClean:
要清除Google Maps-Recent-Search-Suggestions:
To clear Google-Maps-Recent-Search-Suggestions:
SearchRecentSuggestions mapsrs = new SearchRecentSuggestions(this.getBaseContext(), "com.google.android.maps.SearchHistoryProvider", 1);
mapsrs.clearHistory();
仍然无法清除导航的最新目的地,尝试过,但似乎没有等效的内容..?
Still doesn't clear recent destination of Navigation, tried but there seems to be no equivalent..?
重要提示:
一旦您执行mapsrs.clearHistory();之后,当Maps-Application被强制停止后,您的应用也会被被杀死.可能我想取消注册/取消同步提供程序.但是我现在还是放弃尝试重置它.
Once you do mapsrs.clearHistory(); Afterwards when the Maps-Application gets force-stopped afterwards, your Application will be killed, too. Probably I'm missing to unregister/unsync the Provider. But I have abandoned to try to reset it now anyways.