I need to know when the device is connected or disconnected to a dock (car or desk). To do that I have a broadcast receiver and this line in the Manifest:
<action android:name="android.intent.action.ACTION_DOCK_EVENT"/>
And this is the receiver:
@Override public void onReceive(Context context, Intent intent)
{
if(intent.getAction().equals("android.intent.action.ACTION_DOCK_EVENT")
{ //This is a Dock event.
//How can I know here if the event is connected or disconnected?
//Can I also know if is it is a Car or a Desk dock?
}
}
How can I know here if the event is connected or disconnected? Can I also know if is it is a Car or a Desk dock?