title: Update the UI of the calling activity or start a new activity when the alarm is triggered from a broadcast receiver
body: <p>I am writing an alarm code and using a broadcast receiver. I am able to receive the broadcast receiver. but now I want to come back to the calling activity and update the UI of my activity. I am not able to this. 
  I used the following code in my activity but it is never executing that code.</p>
  
  <pre><code> private BroadcastReceiver myBroadcastReceiver = new BroadcastReceiver() {
      @Override
      public void onReceive(Context context, Intent intent) {
          Toast.makeText(context, "I am back!!", Toast.LENGTH_LONG).show();
      }
    };
  
  
    @Override
      protected void onPause()
      {
          super.onPause();
          unregisterReceiver(myBroadcastReceiver);
      }
  
      @Override
      protected void onResume()
      {
          super.onResume();
          IntentFilter intentFilter = new IntentFilter("com.test.Main");
          registerReceiver(myBroadcastReceiver, intentFilter);
      }
  </code></pre>
  
  <p>in the manifest file I have included the following, here gotAlarm is the broadcast receiver file</p>
  
  <pre><code>   &lt;receiver android:name=".gotAlarm"
          android:enabled="true"&gt;
          &lt;/receiver&gt;
  </code></pre>
  
  <p>gotAlarm file is one which gets called from the pending intent of the alarm set</p>
  
  <pre><code>public class gotAlarm extends BroadcastReceiver {
  public void onReceive(Context context, Intent intent){
      Toast.makeText(context, "Wake Up!!", Toast.LENGTH_LONG).show();
  
     }
   }
  </code></pre>
  
  <p>May be I am missing something very basic. 
  please help.</p>