编程清除地图​​缓存

编程清除地图​​缓存

问题描述:

我在与Android谷歌地图API V2创建了SupportMapFragment启用高速缓存。我希望能够在应用程序中编程方式清除我的程序的缓存,要求被征收我。我做这个使用trimCache()方法,这里介绍由crony_cd 的。

I have caching enabled in my SupportMapFragment created with the Android Google Maps API v2. I'd like to be able to programmatically clear the cache of my program within the application itself, a requirement being levied on me. I am doing this using the trimCache() method described here by crony_cd.

当我虽然执行这种方法,它只是似乎被删除一小块缓存,presumably缓存文件,我自己的应用程序创建,而不是由谷歌地图API创建的缓存文件。是否有可能抹了地图API产生的缓存?

When I execute this method though, it only seems to be deleting a small piece of the cache, presumably the cache files that my own application is creating, not the cache files created by the Google Maps API. Is it possible to wipe the cache that the Maps API produces?

据我所知没有。缓存由谷歌地图图书馆的一个项目,以项目为基础的控制。这意味着瓷砖缓存使用的地图每个应用程序。当你决定使用谷歌地图图书馆你也必须忍受这一点,试图删除这些文件或者做一些与反思,只会可能与谷歌的服务未来的更新打破你的应用程序。

As far as I know no. The cache is controlled by Googles maps library on a project to project basis. That means tiles are cached for each app using maps. When you've decided to use Googles Maps library you'll also have to live with this, trying to remove these files or doing something with reflection will only possibly break your app with future updates of Google services.