Сравнить коммиты
| Автор | SHA1 | Дата | |
|---|---|---|---|
|
|
1d6da0c9d9 | ||
|
|
be4f842a79 | ||
|
|
f611b1b597 |
@@ -24,6 +24,7 @@ import android.location.LocationManager;
|
||||
import android.location.LocationProvider;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.widget.Toast;
|
||||
|
||||
public class PositionProvider {
|
||||
|
||||
@@ -39,6 +40,7 @@ public class PositionProvider {
|
||||
private final LocationManager locationManager;
|
||||
private final long period;
|
||||
private final PositionListener listener;
|
||||
private final Context context;
|
||||
|
||||
private boolean useFine;
|
||||
private boolean useCoarse;
|
||||
@@ -48,6 +50,7 @@ public class PositionProvider {
|
||||
locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
||||
this.period = period;
|
||||
this.listener = listener;
|
||||
this.context = context;
|
||||
|
||||
// Determine providers
|
||||
if (type.equals(PROVIDER_MIXED)) {
|
||||
@@ -81,6 +84,12 @@ public class PositionProvider {
|
||||
private boolean tryProvider(String provider) {
|
||||
Location location = locationManager.getLastKnownLocation(provider);
|
||||
|
||||
/*if (location != null) {
|
||||
Toast.makeText(context, "phone: " + new Date() + "\ngps: " + new Date(location.getTime()), Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
Toast.makeText(context, "no location", Toast.LENGTH_LONG).show();
|
||||
}*/
|
||||
|
||||
if (location != null && new Date().getTime() - location.getTime() <= period + PERIOD_DELTA) {
|
||||
listener.onPositionUpdate(location);
|
||||
return true;
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
<string name="settings_status_on">Stop</string>
|
||||
<string name="settings_status_off_summary">Dienst inaktiv</string>
|
||||
<string name="settings_status_on_summary">Dienst aktiv</string>
|
||||
<string name="settings_extended_title">Erweiterte Format</string>
|
||||
<string name="settings_extended_summary">Verwenden Sie neue Nachrichtenformat</string>
|
||||
<string name="settings_extended_title">Erweitertes Format</string>
|
||||
<string name="settings_extended_summary">Verwenden Sie das neue Nachrichtenformat</string>
|
||||
<string name="settings_provider_title">Datenherkunft</string>
|
||||
<string name="settings_provider_summary">Quelle der Positionen</string>
|
||||
<string-array name="settings_provider_names">
|
||||
|
||||
Ссылка в новой задаче
Block a user