title: Intercept SMS message
body: <p>So I have an application, which should make a phone call when receiving a specific message from a specific phone number.
  The broadcast receiver works on a Samsung Galaxy Tab2, on Android 4.0.3, but the messages are not received any more by Go SMS Pro, if no phone call has to be made.
  When running the application on Samsung Galaxy S2 (Android 4.0.3), the broadcast receiver seems to not intercept at all the messages and Go SMS Pro works correctly.
  I have tried to use "abortBroadcast" and "clearAbortBroadcast", but they had no effect.</p>
  
  <p>Here is the code for my broadcast receiver:</p>
  
  <pre><code>public class SMSReceiver extends BroadcastReceiver{
  /** The Action fired by the Android-System when a SMS was received.
   * We are using the Default Package-Visibility */
  
  private static final String SMS_EXTRA_NAME = "pdus";
  
  
  @Override
  public void onReceive(Context context, Intent intent) {
      Toast.makeText(context, "Message received", Toast.LENGTH_LONG).show();
      StringBuilder sb = new StringBuilder();
      sb.append("");
      if(intent.getAction().equals(Consts.ACTION)) {
  
          Bundle bundle = intent.getExtras();
          if(bundle != null)
          {
              //Get received SMS array
              Object[] smsExtra = (Object[]) bundle.get(SMS_EXTRA_NAME);
  
              for ( int i=0; i &lt; smsExtra.length; i++)
              {
                  SmsMessage sms = SmsMessage.createFromPdu((byte[])smsExtra[i]);
                  String body = sms.getMessageBody().toString();
                  String address = sms.getOriginatingAddress();
                  if(address.equals(Consts.COPCI_NUMBER)) {
                      sb.append(body);
                  }
              }
          }
          if(sb.toString().equals(Consts.TRIGGER_MESSAGE))
          {
              Intent dial = new Intent(Intent.ACTION_CALL);
              dial.setData(Uri.parse("tel: " + Consts.POLI_NUMBER));
              dial.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
              context.startActivity(dial);
  
          }
          else {
          }
  
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>And this is the AndroidManifest:</p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.example.Parcare"
        android:versionCode="1"
        android:versionName="1.0" &gt;
  
  &lt;uses-permission android:name="android.permission.RECEIVE_SMS"/&gt;
  &lt;uses-permission android:name="android.permission.SEND_SMS"/&gt;
  &lt;uses-permission android:name="android.permission.CALL_PHONE"/&gt;
  &lt;uses-sdk
          android:minSdkVersion="8"
          android:targetSdkVersion="18" /&gt;
  &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt;
      &lt;receiver android:name="com.example.Parcare2.SMSReceiver" android:priority="100"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.provider.Telephony.SMS_RECEIVED" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p></p>