0

I need to retrive SMS in different activities several times.

For SMS retrive I start smsRetriver in my activity.

SmsRetrieverClient client = SmsRetriever.getClient(context);
Task<Void> task = client.startSmsRetriever();

If I have to to do it every time or once in an Application?

Anisuzzaman Babla
  • 6,510
  • 7
  • 36
  • 53
  • Once anywhere in you app is fine, could be activity or your app. Think of registering a broadcast, this is just like that also note that after registering, it will throw a Timeout after 5 minutes. – shadygoneinsane Mar 28 '19 at 09:28
  • 1
    As far as I know, once the `SmsRetrieverClient` starts, it waits for ONE matching SMS until the timeout of 5 minutes. If you have multiple activity, you will need to call this method every time. Check this [blog](https://proandroiddev.com/no-more-sms-call-log-permissions-now-what-9b8226de7827) for more details. – Jessica Rodriguez Mar 28 '19 at 16:07

0 Answers0