Changeset View
Changeset View
Standalone View
Standalone View
src/it/reyboz/bustorino/fragments/MainScreenFragment.java
| Show First 20 Lines • Show All 125 Lines • ▼ Show 20 Lines | private AppLocationManager.LocationRequester requester = new AppLocationManager.LocationRequester() { | ||||
| } | } | ||||
| @Override | @Override | ||||
| public void onLocationStatusChanged(int status) { | public void onLocationStatusChanged(int status) { | ||||
| if(status == AppLocationManager.LOCATION_GPS_AVAILABLE && !isNearbyFragmentShown()){ | if(status == AppLocationManager.LOCATION_GPS_AVAILABLE && !isNearbyFragmentShown()){ | ||||
| //request Stops | //request Stops | ||||
| pendingNearbyStopsRequest = false; | pendingNearbyStopsRequest = false; | ||||
| if (getContext()!= null) | |||||
| mainHandler.post(new NearbyStopsRequester(getContext(), cr)); | mainHandler.post(new NearbyStopsRequester(getContext(), cr)); | ||||
| } | } | ||||
| } | } | ||||
| @Override | @Override | ||||
| public long getLastUpdateTimeMillis() { | public long getLastUpdateTimeMillis() { | ||||
| return 50; | return 50; | ||||
| } | } | ||||
| @Override | @Override | ||||
| public LocationCriteria getLocationCriteria() { | public LocationCriteria getLocationCriteria() { | ||||
| return cr; | return cr; | ||||
| } | } | ||||
| @Override | @Override | ||||
| public void onLocationProviderAvailable() { | public void onLocationProviderAvailable() { | ||||
| //Log.w(DEBUG_TAG, "pendingNearbyStopRequest: "+pendingNearbyStopsRequest); | //Log.w(DEBUG_TAG, "pendingNearbyStopRequest: "+pendingNearbyStopsRequest); | ||||
| if(!isNearbyFragmentShown()){ | if(!isNearbyFragmentShown() && getContext()!=null){ | ||||
| pendingNearbyStopsRequest = false; | pendingNearbyStopsRequest = false; | ||||
| mainHandler.post(new NearbyStopsRequester(getContext(), cr)); | mainHandler.post(new NearbyStopsRequester(getContext(), cr)); | ||||
| } | } | ||||
| } | } | ||||
| @Override | @Override | ||||
| public void onLocationDisabled() { | public void onLocationDisabled() { | ||||
| ▲ Show 20 Lines • Show All 535 Lines • ▼ Show 20 Lines | class NearbyStopsRequester implements Runnable { | ||||
| } else if(!haveProviders){ | } else if(!haveProviders){ | ||||
| Log.e(DEBUG_TAG, "NO PROVIDERS FOR POSITION"); | Log.e(DEBUG_TAG, "NO PROVIDERS FOR POSITION"); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| No newline at end of file | No newline at end of file | ||||
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