开发者

how to find out when the user had switched on the gps and wifi in android?

开发者 https://www.devze.com 2023-04-01 17:11 出处:网络
i have made an android application in which i need user\'s gps and internet connection. Now if the user has not switched any of the above on, then i show a message to th开发者_如何学运维e user to swi

i have made an android application in which i need user's gps and internet connection. Now if the user has not switched any of the above on, then i show a message to th开发者_如何学运维e user to switch on their gps and internet.

Once the user reads this message and switches his gps and internet on, i need to reload my activity. To do this i need to capture the event when the user has switched on his gps/wifi and then reload my activity.

How do i achieve this?

Thank you in advance.


BroadCastReceiver & NetworkManager will solve your problem. This will help you.. Detect 3G or Wifi Network restoration

0

精彩评论

暂无评论...
验证码 换一张
取 消