Hi Karoly,

their is no real sdk support to detect usb connect/disconnect.
( btw ..UMS == usb mass storage ). So don't expect that this
will work reliably. I expect that this intent will not be sent, when
you change
to a  non mass storage usb mode ( like mtp, pictbridge or others) if
the
concrete device support them.

Good luck ! Frank


On 27 Mrz., 19:58, Károly Holczhauser <[email protected]> wrote:
> Hi all!
>
>  I had read in a lot of forum it is a problem to developers to write a
> program witch can detect the connected / disconnected USB event. Here is my
> solution:
>
> Manifest.xml :
>
>         <receiver android:name=".MyReceiver">
>             <intent-filter>
>                 <action android:name="android.intent.action.ums_connected"
> />
>             </intent-filter>
>         </receiver>
>
> Myreceiver:
>
> public class MyReceiver extends BroadcastReceiver{
> if (intent.getAction().equalsIgnoreCase(
>         "android.intent.action.UMS_CONNECTED")) {...}
>
> }
>
> bye:Károly Holczhauser from Hungary

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

Reply via email to