不要なインスタンスを作成しないように
This commit is contained in:
parent
da545e4a5e
commit
0a2cabd0af
|
@ -266,7 +266,6 @@ public class TestService extends Service {
|
||||||
// -----------------------------------------------------
|
// -----------------------------------------------------
|
||||||
|
|
||||||
SharedPreferences pref = getSharedPreferences("Bluetooth_situation", MODE_PRIVATE);
|
SharedPreferences pref = getSharedPreferences("Bluetooth_situation", MODE_PRIVATE);
|
||||||
SharedPreferences.Editor e = pref.edit();
|
|
||||||
String action = intent.getAction(); // may need to chain this to a recognizing function
|
String action = intent.getAction(); // may need to chain this to a recognizing function
|
||||||
boolean isInCar = pref.getBoolean("isInCarPref", false);
|
boolean isInCar = pref.getBoolean("isInCarPref", false);
|
||||||
if (BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(action) && !isInCar) {
|
if (BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(action) && !isInCar) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user