Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
joey-mbk committed May 11, 2012
1 parent 7b988e0 commit fec0044
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
2 changes: 2 additions & 0 deletions res/values/strings.xml
Expand Up @@ -88,6 +88,8 @@ you do not know well.
<string name="create_profile_interests_title">Choose your interests</string>
<string name="create_profile_languages_title">Select your languages in the order that suits you</string>

<string name="directions_error_gps">Error: no GPS signal.</string>

<string name="create_itinerary_label">Create new itinerary</string>

<string name="settings_title">Settings</string>
Expand Down
22 changes: 17 additions & 5 deletions src/com/mobilecityguide/activity/Directions.java
Expand Up @@ -59,13 +59,25 @@ public void onCreate(Bundle savedInstanceState) {
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, this);
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this);

String url = GPSController.getUrl(userLocation, poiLocation);
InputStream is = getConnection(url);
mRoad = GPSController.getRoute(is);

setContentView(R.layout.directions);

addDirections();
if (userLocation != null) {
String url = GPSController.getUrl(userLocation, poiLocation);
InputStream is = getConnection(url);
mRoad = GPSController.getRoute(is);
addDirections();
}
else {
TextView poiTitle = new TextView(this);
String poiName = POIController.getPOIName(poi);
poiTitle.setText(poiName);
poiTitle.setTextAppearance(this, android.R.style.TextAppearance_Large);
TextView error = new TextView(this);
poiTitle.setText(R.string.directions_error_gps);
LinearLayout layout = (LinearLayout) findViewById(R.id.directions);
layout.addView(poiTitle);
layout.addView(error);
}
}

private void addDirections() {
Expand Down

0 comments on commit fec0044

Please sign in to comment.