73 |
|
|
74 |
|
|
75 |
|
|
76 |
public static final int OPTIONS_MAP = 1003; |
public static final int OPTIONS_MAP = 103; |
77 |
public static final int OPTIONS_GPSINFO = 1004; |
public static final int OPTIONS_GPSINFO = 104; |
78 |
|
|
79 |
public static final int DLG_PROGRESS = 3001; |
public static final int DLG_PROGRESS = 3001; |
80 |
public static final int DLG_STATIONNAME = 3002; |
public static final int DLG_STATIONNAME = 3002; |
231 |
item.setIcon(android.R.drawable.ic_menu_mapmode); |
item.setIcon(android.R.drawable.ic_menu_mapmode); |
232 |
|
|
233 |
item = menu.add(0, OPTIONS_GPSINFO, 0, getString(stationlist_gpsinfo)); |
item = menu.add(0, OPTIONS_GPSINFO, 0, getString(stationlist_gpsinfo)); |
234 |
item.setIcon(android.R.drawable.ic_menu_mapmode); |
item.setIcon(android.R.drawable.ic_menu_info_details); |
235 |
boolean hasLoc = (locationLookup.getLocation() != null); |
boolean hasLoc = (locationLookup.getLocation() != null); |
236 |
item.setEnabled(hasLoc); |
item.setEnabled(hasLoc); |
237 |
|
|
245 |
public boolean onOptionsItemSelected(MenuItem item) { |
public boolean onOptionsItemSelected(MenuItem item) { |
246 |
boolean retval = true; |
boolean retval = true; |
247 |
|
|
248 |
//TODO: Cleanup |
|
249 |
switch (item.getItemId()) { |
switch (item.getItemId()) { |
250 |
case OPTIONS_MAP: |
case OPTIONS_MAP: |
251 |
|
|
252 |
|
if ( stations == null || stations.entries == null || stations.entries.size() == 0 ) { |
253 |
|
Toast.makeText(this, "No stations to show on map", Toast.LENGTH_SHORT).show(); //TODO: Translate |
254 |
|
return true; |
255 |
|
} |
256 |
|
|
257 |
Intent intent = new Intent(this,StationMapView.class); |
Intent intent = new Intent(this,StationMapView.class); |
258 |
|
|
259 |
ArrayList<GeoPair> stationPoints = new ArrayList<GeoPair>(); |
ArrayList<GeoPair> stationPoints = new ArrayList<GeoPair>(); |