title: wait until wifi connected on android
body: <p>I have a small program that trying to connect to a wifi network.
  It enables the wifi on the device then if it's the first time that is connect to the certain networkss It loads the device wifi in order to select and add the password for connection.
  Until I add the password in order to connect the program should not be finished.
  How can I add something to wait until I get from the wifi manager that is connected?
  I try sleep but it freeze the application and am not getting the wifi pop up menu to connect?
  are there any other ways?</p>