thank you all for the help. I got it. Cindy
On Sep 16, 5:59 am, TreKing <treking...@gmail.com> wrote: > On Thu, Sep 16, 2010 at 1:56 AM, cindy <ypu01...@yahoo.com> wrote: > > ANy example to use the api? I am confused. > > FilenameFilter has a single method "accept(File dir, String filename)" which > returns true if the given parameters are what you're looking for. > > So you implement a class that extends FilenameFilter and override the accept > method to return true if the given parameters are what you're looking for. > So in your case you could check "filename" for starting with "voice" and > ending in ".amr". > > Then you use the File.list() method with an instance of your newly defined > class to get all the files that match your criteria. Then it's a simple > matter of iterating the list and calling File.delete(). > > Hope that helps. > > And do test thoroughly so you don't end up deleting all of the user's SD > card contents =P > > ------------------------------------------------------------------------------------------------- > TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago > transit tracking app for Android-powered devices -- 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