0

I have a very simple question. When a device like (galaxy tab) is connected to a computer in mass storage mode; both internal and external sd-card become unavailable. I just want to know if there is any way of determining if internal storage is not available because the device is in usb mass storage mode..

Thanks to all

Farhan
  • 3,206
  • 14
  • 49
  • 62
  • You have to use a PendingIntent: http://stackoverflow.com/questions/4600896/android-detecting-usb – b_yng Aug 26 '11 at 19:17
  • are you wanting to check at a specific point in your application, or be notified when the status of the storage changes? its not clear. – pogo2065 Jun 16 '12 at 04:34

1 Answers1

0

For API version 8, I think the following will work.

Use a broadcast receiver that listens to ACTION_UMS_CONNECTED

For versions beyond 8, use android.os.storage.EventListener. Check this out.

Heshan Perera
  • 4,592
  • 8
  • 44
  • 57