Fixed issue with system not shutting down properly using new UI (#133) - it was the fragments remaining bound to the server, preventing it shutting down. Fixed by making the 'stop' option an 'Exit' which shuts down the server and exits the main activity.
This commit is contained in:
@@ -178,7 +178,10 @@ public class MainActivity2 extends AppCompatActivity {
|
|||||||
Log.i(TAG, "Stopping Server");
|
Log.i(TAG, "Stopping Server");
|
||||||
mUtil.unbindFromServer(getApplicationContext(), mConnection);
|
mUtil.unbindFromServer(getApplicationContext(), mConnection);
|
||||||
stopServer();
|
stopServer();
|
||||||
//finish();
|
// We exit this activity as a crude way of forcing the fragments to disconnect from the server
|
||||||
|
// so that the server exits properly - otherwise we end up with multiple threads running.
|
||||||
|
// FIXME - tell the threads to unbind from the serer before calling stopServer as an alternative.
|
||||||
|
finish();
|
||||||
} else {
|
} else {
|
||||||
Log.i(TAG, "Starting Server");
|
Log.i(TAG, "Starting Server");
|
||||||
startServer();
|
startServer();
|
||||||
|
|||||||
@@ -112,7 +112,7 @@
|
|||||||
<string name="BasicPrefTitle">Basic</string>
|
<string name="BasicPrefTitle">Basic</string>
|
||||||
<string name="BasicPrefSummary">Basic Preferences</string>
|
<string name="BasicPrefSummary">Basic Preferences</string>
|
||||||
<string name="accept_alarm">Accept Alarm</string>
|
<string name="accept_alarm">Accept Alarm</string>
|
||||||
<string name="start_stop_server">Start/Stop Server</string>
|
<string name="start_stop_server">Exit</string>
|
||||||
<string name="install_watch_app">Install Watch App</string>
|
<string name="install_watch_app">Install Watch App</string>
|
||||||
<string name="test_alarm_beep">Test Alarm Beep</string>
|
<string name="test_alarm_beep">Test Alarm Beep</string>
|
||||||
<string name="test_warning_beep">Test Warning Beep</string>
|
<string name="test_warning_beep">Test Warning Beep</string>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
android:defaultValue="Phone"
|
android:defaultValue="Phone"
|
||||||
android:dialogTitle="@string/select_datasource_title" />
|
android:dialogTitle="@string/select_datasource_title" />
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="true"
|
||||||
android:key="UseNewUi"
|
android:key="UseNewUi"
|
||||||
android:summary="@string/use_new_ui_summary"
|
android:summary="@string/use_new_ui_summary"
|
||||||
android:title="@string/use_new_ui_title" />
|
android:title="@string/use_new_ui_title" />
|
||||||
|
|||||||
Reference in New Issue
Block a user