I am not entirely clear on when one should use android.intent.category.DEFAULT in their intent filter. Most of the examples I have seen use it without explaining why.
In my particular case, I am trying to have my app launch when the device is placed in the car dock. However, it would not launch until I added the default category:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.CAR_DOCK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
Now here is the strange part: when I call getIntent() in my activity, the only category it contains is android.intent.category.CAR_DOCK. I thought that a particular category needed to be in an intent filter only if that category was in the intent that was broadcast, but in this case the default category was NOT in the intent, yet it still seems to be required. What am I missing?
In my particular case, I am trying to have my app launch when the device is placed in the car dock. However, it would not launch until I added the default category:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.CAR_DOCK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
Now here is the strange part: when I call getIntent() in my activity, the only category it contains is android.intent.category.CAR_DOCK. I thought that a particular category needed to be in an intent filter only if that category was in the intent that was broadcast, but in this case the default category was NOT in the intent, yet it still seems to be required. What am I missing?