Take the 2-minute tour ×

I use requestLocationUpdates listener receives data. how can I determine that works requestLocationUpdates? need a method that will bring back true - if requestLocationUpdates enabled or false if I turned it off (removeUpdates)

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

There is no such method. For the LocationListener flavor of requestLocationUpdates(), it is pretty easy for you to track it yourself:

Step #1: Add a data member to some class, of type boolean, named areLocationUpdatesEnabled, initially set to false.

Step #2: When you call requestLocationUpdates(), set areLocationUpdatesEnabled to true.

Step #3: When you call removeUpdates(), set areLocationUpdatesEnabled to false.

Step #4 (optional): Implement areLocationUpdatesEnabled() as a method to return the value of areLocationUpdatesEnabled.

share|improve this answer
add comment

Your Answer


