Even I am granting run time permission for read sms, I am not able to received broadcast for incoming sms and Cursor return by Content Provider is also returning 0 data every time while reading sms inbox.
Any idea why?
Even I am granting run time permission for read sms, I am not able to received broadcast for incoming sms and Cursor return by Content Provider is also returning 0 data every time while reading sms inbox.
Any idea why?
Check whether your application has the permission to read sms in your phone.
It may happen that targeted sdk version is less than 23 and you are only providing permission in the manifest and not programmatically checking for the permission explicitly.
Try to change the priority of the filter 100 in the manifest file.
Why use ContentProvider
for Broadcast messages if the method onRecieve
possible to get the message?
Also, check method the onRecieve, this method should be performed as quickly as possible. You can connect the service for time-consuming operations.
If you granted RECEIVE_SMS
, but not the READ_SMS
then ContentProvider
should not work.