I\'m trying to scan for wireless networks and found this helpful source on the net. Unfortunately it\'s not working and I have no idea why. My problem is that I can\'t wait 10 m
Where are you putting this code? In the onCreate
of an activity?
The problem is that you're registering a callback which will get called when you receive the scan results, which according to the Android API docs is done in a separate thread, so your busy-waiting loop is achieving nothing in this circumstance except needlessly halting your activity, and if it's during the onCreate
that means it never exits the method.