Select to view content in your preferred language

LocationDisplayManager and Handler Pattern

2298
1
03-24-2014 03:40 AM
ShaunNicholson
New Contributor
Hello

I am starting to use the Android Runtime SDK and was wondering about recommended coding patterns when using the LocationDisplayManager.  I am relatively new to Android development and still learning so likely missing something.

As far as I can tell its common to use the following pattern when defining handlers:

object.registerListener(handler);

object.unregisterListener(handler);

e.g. during the onResume(), onPause() lifecycle.

However, the LocationDisplayManager provides the setLocationListener() method which I am using as (my Activity implements LocationListener):

locationDisplayManager.setLocationListener(this);

Is there a way to use the registerListener(), unregisterListener() pattern?  How would I detach my class from listening to the events defined on the LocationDisplayManager?

Thanks

Shaun
0 Kudos
1 Reply
teamIgal
Deactivated User
Hi,

You can use the Start() and Stop() methods.
0 Kudos