2

I have designed one app, in that I am calling a Fragment which shows a map from FragmentActivity. But, when I retrun back to FragmentActivity from Fragment of Map it shows blackscreen. It loads the list after 20 to 30 seconds..

So, is there is any solution on this which will clear the map cache while returning to FragmentActivity from Fragment so that list on FragmentActivity will be displayed properly..?

Mitesh Shah
  • 1,729
  • 2
  • 19
  • 37

2 Answers2

1

Duplicate: Programmatically clearing map cache

TL;DR - No, you can't clear the GoogleMap cache as of API v2 yourself.

Community
  • 1
  • 1
Fab Castel
  • 552
  • 5
  • 18
0

It's perfectly possible to delete Map Cache

Tiles are stored in your data directory

To see it, use File Explorer

enter image description here

Go in your application data folder to see it:

enter image description here

Programmatically, there is the way to clear it:

context.dataDir
    ?.listFiles()
    ?.first { it.name == "app_tilesFolder" }
    ?.deleteRecursively()

Change the name if the cache folder change in the future

Kevin ABRIOUX
  • 16,507
  • 12
  • 93
  • 99