title: Remember USB connection, but don't launch the application
body: <p>The application that I am working on connects successfully with a device over the USB connection.  </p>
  
  <p>Additionally, it now remembers the device from different launches as also pointed out in the following thread <a href="https://stackoverflow.com/questions/12388914/usb-device-access-pop-up-supression">storing usb default connections</a>.</p>
  
  <p>However, this leaves the undesired effect of always launching the Activity when the USB device is attached.  I have not been able to remember the defaults without launching the application.  Launching the application on a connect is not a desired effect.  Small code samples below are what the manifest currently looks like in order to get the default USB connections stored in memory for future connections at a quick glance.  Can this storage of defaults be done without causing an application launch?</p>
  
  <pre><code>&lt;activity
       android:name="com.MainScreen"
       android:theme="@style/Theme.Default"
       android:configChanges="orientation|keyboardHidden|screenSize"
       android:label="@string/app_name"&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>I had been thinking that perhaps there was a type of category that I could add to the intent filter that would specify it as a non-launchable intent.  Something that was listened for during the activity, but handled by the activity. So far, I haven't found this however.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Declaring the intent for usb device connection within a service or a receiver in the manifest has also been an attempt at storing connection information.  However, only the intent within an activity remembers connection state so that it doesn't need to ask the user a subsequent time when it is re-connected at a later given point in time.  It looks as though it is designed only to save state combined with launching an application when it is connected.  A bit odd, but no workaround for getting a no-launch combined with remembering the default connection for usb attached device.</p>