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:
Graham Jones
2024-01-25 22:15:09 +00:00
parent 4e3a6bb1de
commit bc6d312c6a
3 changed files with 6 additions and 3 deletions

View File

@@ -178,7 +178,10 @@ public class MainActivity2 extends AppCompatActivity {
Log.i(TAG, "Stopping Server");
mUtil.unbindFromServer(getApplicationContext(), mConnection);
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 {
Log.i(TAG, "Starting Server");
startServer();

View File

@@ -112,7 +112,7 @@
<string name="BasicPrefTitle">Basic</string>
<string name="BasicPrefSummary">Basic Preferences</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="test_alarm_beep">Test Alarm Beep</string>
<string name="test_warning_beep">Test Warning Beep</string>

View File

@@ -9,7 +9,7 @@
android:defaultValue="Phone"
android:dialogTitle="@string/select_datasource_title" />
<CheckBoxPreference
android:defaultValue="false"
android:defaultValue="true"
android:key="UseNewUi"
android:summary="@string/use_new_ui_summary"
android:title="@string/use_new_ui_title" />