I had problems with this while developing #BresTram.
I was developing a new feature, allowing my users to find bus stops nearby using their GPS location.
But whatever I was trying, my location was never set, and onLocationChanged was never called.
Here is what my Activity would look like :
You can forget about the ViewFlipper, that is here only to show something to the user.
Basically, I am letting android decide which provider he wants to use (GPS or Network), and request for the last known location.
Then, I want to do something clever each time onLocationChanged is called.
Problem is, it is not. never. Ever. . .
After having verified hundred times that I had
correctly defined in my manifest, and that yes, other GPS based apps were working fine on my phone; I finally found the solution.
As stupid as it seems, I had forgotten to request the updates. . .
Something like that would do the job :
I was somehow expecting that is was automatic, implied by the fact that my activity implements LocationListener.
Well it is not.
So, if any of you has the same problem, look whether you actually ask for something before getting angry because you don’t receive it :D.
Have fun hacking around.
Oh, and if you leave in Brest, give a shot to #BresTram; it is awesome!