diff options
author | Isidro Henoch <imhenoch@protonmail.com> | 2022-01-31 17:42:26 -0600 |
---|---|---|
committer | Isidro Henoch <imhenoch@protonmail.com> | 2022-01-31 17:42:26 -0600 |
commit | 92ab928f9efd238be7232ee4ec5962bfbb5a0e12 (patch) | |
tree | 3dcca296c05f575f0673bf4028907126134d9670 /androidApp/src/main/java/mx | |
parent | 7f1388bc554a3ee68a1865d2a219395805a79575 (diff) | |
download | etbsa-trackermap-mobile-92ab928f9efd238be7232ee4ec5962bfbb5a0e12.tar.gz etbsa-trackermap-mobile-92ab928f9efd238be7232ee4ec5962bfbb5a0e12.tar.bz2 etbsa-trackermap-mobile-92ab928f9efd238be7232ee4ec5962bfbb5a0e12.zip |
Tries to fix the units update issue
Diffstat (limited to 'androidApp/src/main/java/mx')
-rw-r--r-- | androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt | 1 | ||||
-rw-r--r-- | androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsViewModel.kt | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt index 4371eed..a327234 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt @@ -78,6 +78,7 @@ class UnitsActivity : AppCompatActivity() { override fun onDestroy() { super.onDestroy() _binding = null + unitsViewModel.stopUpdates() } private fun setupViews() { diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsViewModel.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsViewModel.kt index d7b6db1..8401ee7 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsViewModel.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsViewModel.kt @@ -90,6 +90,10 @@ class UnitsViewModel( } } + fun stopUpdates() { + unitsController.stopUpdates() + } + fun selectUnit(unit: UnitInformation) { Log.d("UnitsViewModel", "Selecting unit ${unit.device.name}") _selectedUnit.postValue(unit) |