mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-31 20:11:58 +02:00
showing an info message when no Bluetooth device was selected.
This commit is contained in:
@@ -248,7 +248,12 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
String deviceName = prefs.getString("btDeviceName", "MI_SCALE");
|
String deviceName = prefs.getString("btDeviceName", "-");
|
||||||
|
|
||||||
|
if (deviceName == "-") {
|
||||||
|
Toast.makeText(getApplicationContext(), getResources().getString(R.string.info_bluetooth_no_device_set), Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if Bluetooth 4.x is available
|
// Check if Bluetooth 4.x is available
|
||||||
if (deviceName != "openScale_MCU") {
|
if (deviceName != "openScale_MCU") {
|
||||||
|
@@ -158,4 +158,5 @@
|
|||||||
<string name="title_about">Info</string>
|
<string name="title_about">Info</string>
|
||||||
<string name="open_drawer">öffnen</string>
|
<string name="open_drawer">öffnen</string>
|
||||||
<string name="close_drawer">schließen</string>
|
<string name="close_drawer">schließen</string>
|
||||||
|
<string name="info_bluetooth_no_device_set">Kein Bluetooth Gerät ausgewählt</string>
|
||||||
</resources>
|
</resources>
|
@@ -104,6 +104,7 @@
|
|||||||
<string name="info_bluetooth_try_connection">Trying to connect to</string>
|
<string name="info_bluetooth_try_connection">Trying to connect to</string>
|
||||||
<string name="info_bluetooth_connection_lost">Lost Bluetooth connection.</string>
|
<string name="info_bluetooth_connection_lost">Lost Bluetooth connection.</string>
|
||||||
<string name="info_bluetooth_no_device">No Bluetooth device found</string>
|
<string name="info_bluetooth_no_device">No Bluetooth device found</string>
|
||||||
|
<string name="info_bluetooth_no_device_set">No Bluetooth device selected</string>
|
||||||
<string name="info_bluetooth_connection_successful">Connection successful established</string>
|
<string name="info_bluetooth_connection_successful">Connection successful established</string>
|
||||||
<string name="info_bluetooth_init">Initialize Bluetooth device</string>
|
<string name="info_bluetooth_init">Initialize Bluetooth device</string>
|
||||||
<string name="info_bluetooth_connection_error">Bluetooth has an unexpected error</string>
|
<string name="info_bluetooth_connection_error">Bluetooth has an unexpected error</string>
|
||||||
|
Reference in New Issue
Block a user