Avoid uninitialized provider type

Этот коммит содержится в:
Anton Tananaev
2016-09-01 01:56:17 +12:00
родитель 624eefc309
Коммит fa4654c969
2 изменённых файлов: 2 добавлений и 2 удалений
+1 -1
Просмотреть файл
@@ -57,7 +57,7 @@ public abstract class PositionProvider {
deviceId = preferences.getString(MainActivity.KEY_DEVICE, null);
period = Integer.parseInt(preferences.getString(MainActivity.KEY_INTERVAL, null)) * 1000;
type = preferences.getString(MainActivity.KEY_PROVIDER, null);
type = preferences.getString(MainActivity.KEY_PROVIDER, "gps");
}
public abstract void startUpdates();
+1 -1
Просмотреть файл
@@ -64,7 +64,7 @@ public class TrackingController implements PositionProvider.PositionListener, Ne
this.context = context;
handler = new Handler();
preferences = PreferenceManager.getDefaultSharedPreferences(context);
if (preferences.getString(MainActivity.KEY_PROVIDER, null).equals("mixed")) {
if (preferences.getString(MainActivity.KEY_PROVIDER, "gps").equals("mixed")) {
positionProvider = new MixedPositionProvider(context, this);
} else {
positionProvider = new SimplePositionProvider(context, this);