以编程方式清除Android地图历史记录 [英] Clear Android Maps history programmatically

查看:87
本文介绍了以编程方式清除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.

这篇关于以编程方式清除Android地图历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆