Changeset View
Changeset View
Standalone View
Standalone View
src/it/reyboz/bustorino/fragments/NearbyStopsFragment.java
Show First 20 Lines • Show All 576 Lines • ▼ Show 20 Lines | class FragmentLocationListener implements AppLocationManager.LocationRequester{ | ||||
public FragmentLocationListener(LoaderManager.LoaderCallbacks<Cursor> callbacks) { | public FragmentLocationListener(LoaderManager.LoaderCallbacks<Cursor> callbacks) { | ||||
this.callbacks = callbacks; | this.callbacks = callbacks; | ||||
} | } | ||||
@Override | @Override | ||||
public void onLocationChanged(Location location) { | public void onLocationChanged(Location location) { | ||||
//set adapter | //set adapter | ||||
float accuracy = location.getAccuracy(); | float accuracy = location.getAccuracy(); | ||||
if(accuracy<60 && !dbUpdateRunning) { | if(accuracy<100 && !dbUpdateRunning) { | ||||
distance = 20; | distance = 20; | ||||
final Bundle msgBundle = new Bundle(); | final Bundle msgBundle = new Bundle(); | ||||
msgBundle.putParcelable(BUNDLE_LOCATION,location); | msgBundle.putParcelable(BUNDLE_LOCATION,location); | ||||
getLoaderManager().restartLoader(LOADER_ID,msgBundle,callbacks); | getLoaderManager().restartLoader(LOADER_ID,msgBundle,callbacks); | ||||
} | } | ||||
lastUpdateTime = System.currentTimeMillis(); | lastUpdateTime = System.currentTimeMillis(); | ||||
Log.d("BusTO:NearPositListen","can start loader "+ !dbUpdateRunning); | Log.d("BusTO:NearPositListen","can start loader "+ !dbUpdateRunning); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines |
Public contents are in Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) or GNU Free Documentation License (at your option) unless otherwise noted. · Contact / Register