Re: [android-developers] Re: Killi Process with files on SD card
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
<flyingdutchie@gmail.com> 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/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy
_The Busy Coder's Guide to *Advanced* Android Development_ Version 1.6
Available!
--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home