diff --git a/gpsrelaysentinel/src/main/java/cc/winboll/studio/gpsrelaysentinel/MainService.java b/gpsrelaysentinel/src/main/java/cc/winboll/studio/gpsrelaysentinel/MainService.java index 8e3ec41..2b44c87 100644 --- a/gpsrelaysentinel/src/main/java/cc/winboll/studio/gpsrelaysentinel/MainService.java +++ b/gpsrelaysentinel/src/main/java/cc/winboll/studio/gpsrelaysentinel/MainService.java @@ -28,6 +28,7 @@ public class MainService extends Service { private static final int NOTIFICATION_ID = 1; private static final String PREF_NAME = "gps_relay_service_prefs"; private static final String KEY_SERVICE_ENABLED = "service_enabled"; + private int mGpsCount = 0; @Override public void onCreate() { @@ -67,6 +68,7 @@ public class MainService extends Service { mLocationListener = new LocationListener() { @Override public void onLocationChanged(Location location) { + mGpsCount++; String gpsInfo = "Lat: " + location.getLatitude() + ", Lng: " + location.getLongitude(); LogUtils.d(TAG, "Location changed: " + gpsInfo); updateNotification(gpsInfo); @@ -129,7 +131,7 @@ public class MainService extends Service { private void updateNotification(String gpsInfo) { if (mNotificationBuilder != null) { - mNotificationBuilder.setContentText(gpsInfo); + mNotificationBuilder.setContentText(gpsInfo + " | Count: " + mGpsCount); mNotificationManager.notify(NOTIFICATION_ID, mNotificationBuilder.build()); } }