Fixed (I hope) crash during server restart reported during testing, plus minor UI errors corrections.

This commit is contained in:
Graham Jones
2020-11-08 19:09:01 +00:00
parent 8a7bf9627c
commit 3c1d9d10a8
10 changed files with 13 additions and 10 deletions

View File

@@ -1,5 +1,6 @@
package uk.org.openseizuredetector;
/**
*/
@@ -43,8 +44,9 @@ public class LocationFinder implements LocationListener
public void destroy() {
// Cancel location updates
mLocationManager.removeUpdates(this);
if (mLocationManager != null) {
mLocationManager.removeUpdates(this);
}
// cancel the timeout timer
if (mTimeoutTimer != null) {
mTimeoutTimer.cancel();

View File

@@ -594,7 +594,7 @@ public class MainActivity extends AppCompatActivity {
tv.setTextColor(warnTextColour);
tv = (TextView) findViewById(R.id.appTv);
tv.setText(R.string.WatchApp+" ----");
tv.setText(getString(R.string.WatchApp)+" ----");
tv.setBackgroundColor(warnColour);
tv.setTextColor(warnTextColour);

View File

@@ -388,6 +388,7 @@ public class SdServer extends Service implements SdDataReceiver {
// Stop the location finder.
if (mLocationFinder != null) {
mLocationFinder.destroy();
mLocationFinder = null;
}