1

I have followed this tutorial and I got the result where I click the button, the connectivity state is shown (connected to internet or not) and it keeps running for as long as I'm running the app.

But if I exit, the connectivity listener stops working (I added to the code a toast message whenever the state changes and after exiting no message appears even if I connect and disconnect to internet).

Is there a way to make the listener work for as long as the phone is on ? because I have services to run whenever an internet connection is available.

Billal Begueradj
  • 20,717
  • 43
  • 112
  • 130
future engineer
  • 109
  • 1
  • 8

1 Answers1

0

No, it's not possible any more, for more info take a look at this video: https://www.youtube.com/watch?v=vBjTXKpaFj8

T.S
  • 911
  • 8
  • 24
  • If I'm making an app targeting api>=14, do I have to use the "old" method up until api21 and for api>=21, I can use jobscheduler ? because the suggested method in the video is jobscheduler but it's only for api>=21 – future engineer Feb 21 '17 at 08:40