[Android] src: Exclude .nomedia folders from library

Dominique Martinet asmadeus at codewreck.org
Sat Jul 7 20:49:35 CEST 2012


Jean-Baptiste Kempf wrote on Sat, Jul 07, 2012 :
> On Sat, Jul 07, 2012 at 02:36:11PM +0200, Edward Wang wrote :
> > +                if(new File(dir.getAbsolutePath() + "/.nomedia").exists()) {
> > +                    continue;
> 
> Does this not leak?

This is java, I don't think there is any delete() operator or
equivalent... Could be wrong though.
(the GC should pick it up as soon as it gets out of scope, i.e. out of
the if condition; I don't think it'd be better to assign it to a
variable and then set it to null or whatever possible "force delete" you
could find.
cf. http://stackoverflow.com/questions/449409/does-assigning-objects-to-null-in-java-impact-garbage-collection
)

> Ain't there a static function to test existence?

I haven't found any in 10 minutes of googleing, "everyone" seems to use
this way :(

-- 
Asmadeus | Dominique Martinet
Lurking.


More information about the Android mailing list