Obtaining usb cable plugged IN/OUT event using EXTRA_PLUGGED does not work
问题 My intention is to have saved in Preferences current status of Android device usb/power cable: connected/disconnected. From Developer site I see that there are two Intent for obtaining that status: ACTION_POWER_CONNECTED / DISCONNECTED. So I used same code as published at Developers: http://developer.android.com/training/monitoring-device-state/battery-monitoring.html in section Monitor Changes in Charging State. Manifest <receiver android:name=".PowerConnectionReceiver"> <intent-filter>