use of de.tum.in.tumcampusapp.component.other.locations.LocationManager in project TumCampusApp by TCA-Team.
the class TransportController method onRequestCard.
/**
* Inserts a MVV card for the nearest public transport station
*
* @param context Context
*/
@Override
public void onRequestCard(Context context) {
if (!NetUtils.isConnected(context)) {
return;
}
// Get station for current campus
LocationManager locMan = new LocationManager(context);
StationResult station = locMan.getStation();
if (station == null) {
return;
}
List<Departure> cur = getDeparturesFromExternal(context, station.getId());
MVVCard card = new MVVCard(context);
card.setStation(station);
card.setDepartures(cur);
card.apply();
}
use of de.tum.in.tumcampusapp.component.other.locations.LocationManager in project TumCampusApp by TCA-Team.
the class FeedbackActivity method getBackupLocation.
private void getBackupLocation() {
Location backup = new LocationManager(this).getLastLocation();
if (backup != null) {
location = backup;
}
if (location == null) {
// we don't know anything about the location
includeLocation.setChecked(false);
AlertDialog.Builder dialog = new AlertDialog.Builder(this);
dialog.setIcon(R.drawable.ic_location);
dialog.setTitle(R.string.location_services_off_title);
dialog.setMessage(R.string.location_services_off_message);
dialog.setPositiveButton(R.string.ok, null);
dialog.show();
}
}
Aggregations