title: How to trigger work manager when wifi is connected in android?
body: <p>I have app which needs to sync the data as soon as internet is connected on device.</p>
  
  <p>I have the sync work in Worker class and it is working fine. But I need to run this class as soon as internet is connected in phone. As broadcast receiver's on connection change is not recommended and deprecated, I need a way to fire up my class when internet is connected so that the data gets synced. How can I achieve this?</p>
  
  <p>I also thought to schedule the work manager when user exists the app and keep condition of Internet connected but when app is closed from recent the onDestroy is not called. Do you have any solution or logic for this please?</p>