title: Display Toast for a BroadcastReceiver
body: <p>I'm learning about <strong>BroadcastReceiver</strong>. </p>
  
  <p>I would like display Toast message when SDcard is mounted or unmounted.</p>
  
  <p>I followed few example provided on SO and wrote below code. However, when I mount/unmount SDCARD (Settings->Unmount SDCard), message "Hello there" is not displayed. </p>
  
  <p>Thanks for any help.</p>
  
  <pre><code>&lt;receiver
      android:name="MountReceiver"
      android:enabled="true"
      android:exported="true"&gt;
      &lt;intent-filter&gt;
          &lt;action android:name="android.intent.action.MEDIA_UNMOUNTED" /&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>MainActivity.java:</p>
  
  <pre><code>public class MountReceiver extends BroadcastReceiver {
      public MountReceiver(){
  
      }
      @Override
      public void onReceive
              (Context context, Intent intent) {
          // react to the event
          Toast.makeText(MainActivity.this
                  , "Hello there", Toast.LENGTH_SHORT).show();
  
      }
  }
  </code></pre>