title: Not receiving ACTION_USB_ACCESSORY_ATTACHED unless accessory app is closed
body: <p>I have my App's manifest set to use the com.android.future.usb.accessory library and filter for USB_ACCESSORY_ATTACHED:</p>
  
  <pre><code>&lt;application
      ...
      &lt;uses-library android:name="com.android.future.usb.accessory" /&gt;
  
      &lt;activity
          android:name="com.example.usb.MainActivity"
          ...
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" /&gt;
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;         
          &lt;/intent-filter&gt;
  
          &lt;meta-data android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"
              android:resource="@xml/accessory_filter" /&gt;
      &lt;/activity&gt;
  
     ...
  &lt;/application&gt;
  </code></pre>
  
  <p>I then receive the intent in my MainActivity via</p>
  
  <pre><code>protected void onNewIntent(Intent intent) {
               String action = intent.getAction();
               Log.d(TAG, "New Intent Action " + action);
                  if (UsbManager.ACTION_USB_ACCESSORY_ATTACHED.equals(action)) {
                     Toast.makeText(getBaseContext(), "Device Attached", Toast.LENGTH_LONG).show();
                  }
          super.onNewIntent(intent);
      }
  </code></pre>
  
  <p>For some reason I only receive this intent if the application I'd like to connect to is not running on the other device.  Does anybody know why, or have a workaround?</p>