Fixed (I hope) crash during server restart reported during testing, plus minor UI errors corrections.
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -388,6 +388,7 @@ public class SdServer extends Service implements SdDataReceiver {
|
||||
// Stop the location finder.
|
||||
if (mLocationFinder != null) {
|
||||
mLocationFinder.destroy();
|
||||
mLocationFinder = null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user