Detect thumb drive(flash drive) when plugged in android via OTG cable
<p>I am trying to detect a flash drive plugged in an android tablet. Based on what i've seen is out there, i tried registering a receiver like below but that does not work:</p>

<pre><code> &lt;receiver android:name=".receiver.UsbBroadcastReceiver"
              android:enabled="true"&gt;
        &lt;intent-filter&gt;
            &lt;action android:name="android.intent.action.MEDIA_MOUNTED"/&gt;
            &lt;data android:scheme="file"/&gt;
        &lt;/intent-filter&gt;
&lt;/receiver&gt;
</code></pre>

<p>I have the following permissions:</p>

<pre><code>&lt;uses-permission android:name="android.permission.INTERNET"/&gt;
&lt;uses-permission android:name="android.permission.READ_LOGS"/&gt;
&lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/&gt;
&lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt;
&lt;uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" /&gt;
&lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
&lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
</code></pre>

<p>I don't see a security exception either. Is polling the only way?</p>