Ander Acosta Ander Acosta - 1 year ago 106
Android Question

SMS Broadcast Receiver not called on Android 6

I am trying to capture the SMS received on the phone, but when the phone receives an SMS message the method 'onReceive' is not called. This is my code:

I have the BroadcastReceiver is declared in the 'AndroidManifest.xml' inside the tag 'application':

<receiver android:name=".util.IncomingSmsReceiver"
<intent-filter android:priority="2147483647">
<action android:name="android.provider.Telephony.SMS_RECEIVED" />

This is the

public class IncomingSmsReceiver extends BroadcastReceiver {

public static final String SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED";

public void onReceive(Context context, Intent intent) {

Log.i(TAG, "onReceive executed");
if (intent.getAction().equals(SMS_RECEIVED)) {

I'm doing the tests on an emulator Google Nexus 5 with Android 6. When I send a sms (fake) in the emulator a notification appears as if it was received really well and I can use it in the default application that brings the emulator. In the logcat of Android Studio does not appear that you have run the method
, or the code written inside.I've tried to change the priority, I've tried using
, I've tried using
and I have not gotten it to work. Does anyone know if I miss something?

Answer Source

Are you using a default messaging app with "Disable other apps" flag on?

Please see this:

"android.provider.Telephony.SMS_RECEIVED" not working on my device (HTC Wildfire) - how to debug?


Since you are using Android 6, you should use the new permissions model. Check this out:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download