title: Merging activity intent-filter categories with Gradle
body: <p>With Gradle is it possible to add <code>&lt;category android:name="android.intent.category.HOME"/&gt;</code> to the intent filter of an activity in a flavor manifest?. My flavor manifest contains an activity with the same name as the base manifest, but I get the following from lint:  <code>Error: Duplicate registration for activity com.xxx.MainActivity [DuplicateActivity]</code></p>
  
  <p>Also, by ignoring Lint I can get a merger but the resulting manifest has both intent-filter blocks from the base and flavor manifests instead of a combination of the two.</p>
  
  <p>Gradle version is 0.12.+ of which <a href="http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger" rel="nofollow">the docs</a> seem to imply it's possible.</p>
  
  <p>The main manifest contains the following activity:</p>
  
  <pre><code>&lt;activity
          android:name=".MainActivity"&gt;
      &lt;intent-filter&gt;
          &lt;action android:name="com.reveldigital.player.RESTART"/&gt;
          &lt;action android:name="android.intent.action.MAIN"/&gt;
  
          &lt;category android:name="android.intent.category.DEFAULT"/&gt;
      &lt;/intent-filter&gt;
      &lt;intent-filter&gt;
          &lt;action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"/&gt;
      &lt;/intent-filter&gt;
  
      &lt;meta-data
              android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
              android:resource="@xml/device_filter"/&gt;
  &lt;/activity&gt;
  </code></pre>
  
  <p>The flavor manifest contains:</p>
  
  <pre><code>&lt;activity android:name="com.xxx.MainActivity"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.reveldigital.player.RESTART"/&gt;
                  &lt;action android:name="android.intent.action.MAIN"/&gt;
  
                  &lt;category android:name="android.intent.category.DEFAULT"/&gt;
                  &lt;category android:name="android.intent.category.HOME"/&gt;
              &lt;/intent-filter&gt;
  &lt;/activity&gt;
  </code></pre>
  
  <p>The result I get is something like this:</p>
  
  <pre><code>&lt;activity android:name=".MainActivity"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.reveldigital.player.RESTART"/&gt;
              &lt;action android:name="android.intent.action.MAIN"/&gt;
  
              &lt;category android:name="android.intent.category.DEFAULT"/&gt;
          &lt;/intent-filter&gt;
  &lt;intent-filter&gt;
                      &lt;action android:name="com.reveldigital.player.RESTART"/&gt;
                      &lt;action android:name="android.intent.action.MAIN"/&gt;
  
                      &lt;category android:name="android.intent.category.DEFAULT"/&gt;
                      &lt;category android:name="android.intent.category.HOME"/&gt;
                  &lt;/intent-filter&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"/&gt;
          &lt;/intent-filter&gt;
  
          &lt;meta-data
                  android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
                  android:resource="@xml/device_filter"/&gt;
  &lt;/activity&gt;
  </code></pre>