You generally shouldn't need to clear it, since the point of that is it
allows the system to delete those files to free up storage when needed.

That said, you do want to keep the amount of data in your cache at a
reasonable size rather than just throwing stuff in there and letting it grow
indefinitely.  The system should eventually get around to deleting your old
files, but everyone is happier if the app is keeping that under control.
This is not the same as deleting when your app "exits" though.

On Sat, Jul 25, 2009 at 3:14 PM, niko001
<greatbytessoftw...@googlemail.com>wrote:

>
> Hi Mark,
>
> thanks for your answer.
>
> I mean the cache that the users can delete themselves by going to
> Settings --> Apps --> Manage Apps --> "My App" --> Clear Cache
>
> Thanks for your suggestion, I'll try it!
>
> Niko
>
>
> On Jul 25, 2:27 am, Mark Murphy <mmur...@commonsware.com> wrote:
> > niko001 wrote:
> > > is it possible to force thecacheof your app to clear when the user
> > > exits the app?
> >
> > > My app piles upcachedata (rightfully so) on each start, which is no
> > > longer needed once the user quits the app, so I am trying to find a
> > > way to forcibly clear it.
> >
> > You could try deleting the files from getCacheDir(), available on
> > Activity, Service, and other flavors of Context.
> >
> > On the other hand, you did not specify whichcacheyou were concerned
> > about...
> >
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com|
> http://twitter.com/commonsguy
> >
> > _The Busy Coder's Guide to *Advanced* Android Development_
> > Version 1.0 Available!
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to