0

I have one simple question: How can I change variables on picture below (INTERVAL and FASTEST_INTERVAL): enter image description here

using button? I tried with this: enter image description here

, and Toast message appears, but I don't think variable is really changed.

Actually, all I want is to change INTERVAL within this: enter image description here

with a simple click of a button.

NathanOliver
  • 171,901
  • 28
  • 288
  • 402
phantom
  • 57
  • 1
  • 1
  • 7
  • Does the toast message have the new increased value or no? – Igor Pejic May 13 '15 at 15:38
  • Yes, it does, Pedja. – phantom May 13 '15 at 15:55
  • 1
    Then call `mLocationRequest.setInterval(INTERVAL)` again with new updated variable. – Igor Pejic May 13 '15 at 15:59
  • [Like so?](http://i.imgur.com/G6D8Ay5.png) It doesn't work. Again, just within a Toast message is changed... – phantom May 13 '15 at 16:18
  • Looking at http://stackoverflow.com/questions/23423293/how-can-i-change-the-interval-of-locationrequest and http://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpdates%28java.lang.String,%20long,%20float,%20android.location.LocationListener%29 might help – Igor Pejic May 13 '15 at 16:33

1 Answers1

1

After you update the interval just call the requestLocationUpdates function again to refresh it.

Igor Pejic
  • 3,658
  • 1
  • 14
  • 32