aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java
diff options
context:
space:
mode:
authorHerbert von Broeuschmeul <Herbert.Broeuschmeul@gmail.com>2010-09-30 23:37:15 +0100
committerHerbert von Broeuschmeul <Herbert.Broeuschmeul@gmail.com>2010-10-11 23:41:04 +0200
commitfad5688f698bd10d91e730e4c5ee284e238d2faa (patch)
treec48c1dd1dccfb1310b1b120976cb966716469d9c /src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java
parent7e2e41c98693afcb7070ee0541f72bb82dc15220 (diff)
downloadBlueGPS-fad5688f698bd10d91e730e4c5ee284e238d2faa.zip
BlueGPS-fad5688f698bd10d91e730e4c5ee284e238d2faa.tar.gz
BlueGPS-fad5688f698bd10d91e730e4c5ee284e238d2faa.tar.bz2
rewrite connection/disconnection parts
Conflicts: src/org/broeuschmeul/android/gps/bluetooth/provider/BlueetoothGpsManager.java src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java
Diffstat (limited to 'src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java')
-rw-r--r--src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java b/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java
index f5f936e..a398e19 100644
--- a/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java
+++ b/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java
@@ -131,30 +131,27 @@ public class BluetoothGpsActivity extends PreferenceActivity implements OnPrefer
}
@Override
- public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
- String key) {
+ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
if (BluetoothGpsProviderService.PREF_START_GPS_PROVIDER.equals(key)){
- boolean val = false;
- if (val = sharedPreferences.getBoolean(key, false)){
+ boolean val = sharedPreferences.getBoolean(key, false);
+ CheckBoxPreference pref = (CheckBoxPreference)findPreference(key);
+ if (pref.isChecked() != val){
+ pref.setChecked(val);
+ } else if (val){
startService(new Intent(BluetoothGpsProviderService.ACTION_START_GPS_PROVIDER));
} else {
startService(new Intent(BluetoothGpsProviderService.ACTION_STOP_GPS_PROVIDER));
}
+ } else if (BluetoothGpsProviderService.PREF_TRACK_RECORDING.equals(key)){
+ boolean val = sharedPreferences.getBoolean(key, false);
CheckBoxPreference pref = (CheckBoxPreference)findPreference(key);
if (pref.isChecked() != val){
pref.setChecked(val);
- }
- } else if (BluetoothGpsProviderService.PREF_TRACK_RECORDING.equals(key)){
- boolean val = false;
- if (val = sharedPreferences.getBoolean(key, false)){
+ } else if (val){
startService(new Intent(BluetoothGpsProviderService.ACTION_START_TRACK_RECORDING));
} else {
startService(new Intent(BluetoothGpsProviderService.ACTION_STOP_TRACK_RECORDING));
}
- CheckBoxPreference pref = (CheckBoxPreference)findPreference(key);
- if (pref.isChecked() != val){
- pref.setChecked(val);
- }
} else if (BluetoothGpsProviderService.PREF_BLUETOOTH_DEVICE.equals(key)){
updateDevicePreferenceSummary();
} else if (BluetoothGpsProviderService.PREF_SIRF_ENABLE_GLL.equals(key)