Stop SMS Distribution

I try not to distribute sms when receiving like this

public class SMSReceiver extends BroadcastReceiver {
@Override
    public void onReceive(Context context, Intent intent) {
        abortBroadcast();
        setResultData(null);
    }
}

AndroidManifest.xml

<receiver android:name=".SMSReceiver" android:enabled="true" android:priority = "100" >
          <intent-filter>
            <action android:name="android.provider.Telephony.SMS_RECEIVED" />
          </intent-filter>
        </receiver>

but it does not work. I have been looking for a fix for several days. any help is appreciated.

thank

+3
source share
2 answers

You need to set the attribute android:priorityto <intent-filter>, not to <receiver>.

eg

<intent-filter android:priority="9999" >

, , Android . , "100". . ( ; .)

http://developer.android.com/guide/topics/manifest/intent-filter-element.html

+6
0

All Articles