The CursorUtils class is one I wrote myself to deal with external storage and phone storage (HTC Incredible).
On Jul 10, 9:30 pm, Mark Murphy <[email protected]> wrote: > Where is this CursorUtils class that you are using? I don't see it in > the SDK or source code. > > Thanks! > > On Sat, Jul 10, 2010 at 9:23 PM, Streets Of Boston > > > > > > <[email protected]> wrote: > > Register your broadcast receiver like this: > > > IntentFilter intentFilter = new > > IntentFilter(Intent.ACTION_MEDIA_EJECT); > > intentFilter.addAction(Intent.ACTION_MEDIA_MOUNTED); > > intentFilter.addDataScheme("file"); > > intentFilter.addDataAuthority("*", null); > > intentFilter.addDataPath((mIsExternal > > ?CursorUtils.EXTERNAL_STORAGE_ROOT > > > > :CursorUtils.PHONE_STORAGE_ROOT).getAbsolutePath(), > > PatternMatcher.PATTERN_LITERAL); > > context.registerReceiver(this, intentFilter); > > > Then close all your files when you get an ACTION_MEDIA_EJECT > > and re-open them (if necessary) on ACTION_MEDIA_MOUNTED. > > (in the 'public void onReceive(Context context, Intent intent)' method > > of this broadcast receiver). > > > (EXTERNAL_STORAGE_ROOT is the standard value for external-storage > > (usually "/sdcard") and PHONE_STORAGE_ROOT is "/emmc" (for HTC > > Incredible and such phones)). > > > I'm not sure if this is the 'official' way of doing it, but it works > > for me. :) > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.6 > Available!- Hide quoted text - > > - Show quoted text - -- 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

