summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Leege <bleege@gmail.com>2015-12-06 18:40:17 -0600
committerBrad Leege <bleege@gmail.com>2015-12-09 12:45:34 -0800
commit96591c47cfb783f473a3edb36d183d7c9b7ab33d (patch)
treeb3298802df265eeb63c02d9b59246e0c919e9729
parent45c7b472adb78600ab9f9c8f82082d6b0af21ba2 (diff)
downloadqtlocation-mapboxgl-96591c47cfb783f473a3edb36d183d7c9b7ab33d.tar.gz
[android] #2954 - LocationServices Singleton setup
-rw-r--r--android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationServices.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationServices.java b/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationServices.java
new file mode 100644
index 0000000000..3646f5d92b
--- /dev/null
+++ b/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationServices.java
@@ -0,0 +1,24 @@
+package com.mapbox.mapboxsdk.location;
+
+public class LocationServices {
+
+ private static LocationServices instance = null;
+
+ /**
+ * Private constructor for singleton LocationServices
+ */
+ private LocationServices() {
+ super();
+ }
+
+ /**
+ * Primary (singleton) access method for LocationServices
+ * @return LocationServices
+ */
+ public static LocationServices getLocationServices() {
+ if (instance == null) {
+ instance = new LocationServices();
+ }
+ return instance;
+ }
+}