2012/8/14 Nikolay Elenkov <[email protected]> > On Tue, Aug 14, 2012 at 7:18 AM, Kostya Vasilyev <[email protected]> > wrote: > > > > > > > The media scanner has a utility class in the framework: > > > > > http://developer.android.com/reference/android/media/MediaScannerConnection.html > > > > The easiest thing you can do is to call static > > MediaScannerConnection.scanFile. > > > > BTW, this method never closes the connection it opens, so you will get > 'leaked service connection' (or some such) warnings in logcat if yo use it. >
Hmm, there is a call to mConnection.disconnect in ClientProxy, line 204: https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/media/java/android/media/MediaScannerConnection.java Perhaps it was added recently? It won't trigger if scanning a particular path element doesn't result in onScanCompleted(), though -- wonder if it can? -- K > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

