title: call activity method from broadcast receiver
body: <p>In the main activity, a layout is loaded that has some input fields and a submit button. When the submit button is clicked, the onClick handler method sends an sms back to the same mobile number :</p>
  
  <pre><code>SmsManager sms = SmsManager.getDefault();
  sms.sendTextMessage(number, null, "hi", null, null);
  </code></pre>
  
  <p>There is a broadcast receiver defined that intercepts the message :</p>
  
  <pre><code>public class SmsReceiver extends BroadcastReceiver {
  
  @Override
  public void onReceive(Context context, Intent intent) {
      Bundle pdusBundle = intent.getExtras();
      Object[] pdus=(Object[])pdusBundle.get("pdus");
      SmsMessage messages=SmsMessage.createFromPdu((byte[]) pdus[0]);
      if(messages.getMessageBody().contains("hi")){
          abortBroadcast();
      }
  
  }
  }
  </code></pre>
  
  <p>Now, from the broadcast receiver, I want to call a function(with parameter), which is within my main activity. Is that possible? If yes, what kind of code should i add in my broadcast receiver ?</p>