broadcastreceiver - SMS Broadcast Receiver not called on Android 6 -
i trying capture sms received on phone, when phone receives sms message method 'onreceive' not called. code:
i have broadcastreceiver declared in 'androidmanifest.xml' inside tag 'application':
<receiver android:name=".util.incomingsmsreceiver" android:exported="true"> <intent-filter android:priority="2147483647"> <action android:name="android.provider.telephony.sms_received" /> </intent-filter> </receiver>
this incomingsmsreceiver.java
public class incomingsmsreceiver extends broadcastreceiver { public static final string sms_received = "android.provider.telephony.sms_received"; @override public void onreceive(context context, intent intent) { log.i(tag, "onreceive executed"); if (intent.getaction().equals(sms_received)) { ... } } }
i'm doing tests on emulator google nexus 5 android 6. when send sms (fake) in emulator notification appears if received , can use in default application brings emulator. in logcat of android studio not appear have run method onreceive
, or code written inside.i've tried change priority, i've tried using android:enabled="true"
, i've tried using registerreceiver
, have not gotten work. know if miss something?
are using default messaging app "disable other apps" flag on?
please see this:
"android.provider.telephony.sms_received" not working on device (htc wildfire) - how debug?
edit:
since using android 6, should use new permissions model. check out: http://developer.android.com/training/permissions/requesting.html
Comments
Post a Comment