title: How to call another method inside BroadcastReceiver onReceive method in android?
body: <p>Hi i am using BroadcastReciever to track the incoming messages and send the messages to the database for storage through webservices. But whenever i called a method inside the onReceive method it is saying error message <code>unable to start receiver</code>.</p>
  
  <pre><code>package com.android.message.alert;
  
  import android.app.AlertDialog;
  import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
  import android.os.Bundle;
  import android.speech.tts.TextToSpeech;
  import android.telephony.SmsMessage;
  import android.util.Log;
  import android.view.View.OnClickListener;
  import android.widget.Toast;
  import com.webservice.call.SendWebservice;
  
  public class MessageListener extends BroadcastReceiver
  {
      TextToSpeech tts;
      public static final String ACTION = "android.provider.Telephony.SMS_RECEIVED";
      @Override
      public void onReceive(Context context, Intent intent) 
      {
          if(intent!=null &amp;&amp; intent.getAction()!=null &amp;&amp; ACTION.compareToIgnoreCase(intent.getAction())==0)
          {
              Bundle bundle = intent.getExtras();
              Object[] pdus = (Object[]) bundle.get("pdus");
              final SmsMessage[] message = new SmsMessage[pdus.length];
              for (int i = 0; i &lt; pdus.length; i++) 
              {
                  message[i] = SmsMessage.createFromPdu((byte[])pdus[i]);
              }
              SendWebservice.sendToWebservice(message[0].getMessageBody());
          }   
      }
  }
  </code></pre>
  
  <p>Any help regarding how to call another method inside the onReceive method would be helpful. Please Help me Regarding this issue.</p>