How can I listen to the installation of an SD card in Android?

I have a program that uses an SD card, so I want to get information if the state of the card changes by registering a listener, if possible. I know the environment class and its methods, but I really do not want to constantly check the state. I would prefer that my program does not close when someone plugs an SD card into their computer.

+6
android listener sd-card
source share
1 answer

Create a BroadcastReceiver for ACTION_MEDIA_MOUNTED and related intentions.

+11
source share

All Articles