ims.map.buttons
Class MyLocationButtonListener

java.lang.Object
  extended by ims.map.buttons.MyLocationButtonListener
All Implemented Interfaces:
android.view.View.OnClickListener

public class MyLocationButtonListener
extends java.lang.Object
implements android.view.View.OnClickListener

Listener associated with the MyLocationButton which listens to click events.

Copyright © 2014 by Daniela Blum

This file is part of GPSChildFinder.
GPSChildFinder is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses.

Author:
Daniela Blum

Constructor Summary
MyLocationButtonListener(Map map, android.content.Context context)
          Constructor.
 
Method Summary
 void onClick(android.view.View v)
          Handles the click events.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyLocationButtonListener

public MyLocationButtonListener(Map map,
                                android.content.Context context)
Constructor.

Parameters:
map - Map class in which the main components of the map.
context - Listener's and map's context
Method Detail

onClick

public void onClick(android.view.View v)
Handles the click events.
If the button is clicked when the location access is turned off or no connection to the location client can be received, a toast is shown with more information for the user.
Otherwise, the button is selected and my location (phone's location) is updated and shown or deselected.

Specified by:
onClick in interface android.view.View.OnClickListener