I have found a solution on 2.2 : before receiving the intent
ACTION_MEDIA_EJECT, there is a few line in the logcat that indicate
the SD card is going to be unmounted. So I just check in the last few
logcat lines with
<Runtime.getRuntime().exec(new String[]{"logcat", "-d", "-t 10",
"VoldCmdListener:V *:S"});> to see if there is the line "D/
VoldCmdListener( ): storage users /mnt/sdcard" which indicate the SD
card is going to be unmounted.

It's not great, but it works.

On 7 oct, 00:08, mkellner <m.kin...@gmail.com> wrote:
> On Aug 28, 3:06 pm, Ken Yang <kuas216...@gmail.com> wrote:
>
> > I did it the same way...
>
> > but it only works on 1.6、2.1 device..
>
> > it's doesn't work on 2.2 device, no matter on nexus one or 2.2
> > emulator...
>
> My code was working fine, receiving ACTION_MEDIA_EJECT when
> the user unmounted the /sdcard.
>
> After update to 2.2, I no longer receive this Intent.
> I went back to a 2.1 device and EJECT works.
>
> Does anyone receive a ACTION_MEDIA_EJECT broadcast with 2.2?

-- 
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

Reply via email to