73 |
|
|
74 |
|
|
75 |
|
|
76 |
public static final int OPTIONS_MAP = 2003; |
public static final int OPTIONS_MAP = 1003; |
77 |
public static final int OPTIONS_GPSINFO = 2004; |
public static final int OPTIONS_GPSINFO = 1004; |
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_mapmode); |
235 |
|
boolean hasLoc = (locationLookup.getLocation() != null); |
236 |
|
item.setEnabled(hasLoc); |
237 |
|
|
238 |
return true; |
return true; |
239 |
} |
} |
240 |
|
|
241 |
|
|
242 |
|
|
243 |
|
|
244 |
@Override |
@Override |
245 |
public boolean onOptionsItemSelected(MenuItem item) { |
public boolean onOptionsItemSelected(MenuItem item) { |
264 |
Location loc = locationLookup.getLocation(); |
Location loc = locationLookup.getLocation(); |
265 |
StringBuffer message = new StringBuffer(); |
StringBuffer message = new StringBuffer(); |
266 |
message.append( getString(stationlist_locationinfo) ).append(":\n"); |
message.append( getString(stationlist_locationinfo) ).append(":\n"); |
267 |
if (loc != null) { |
|
268 |
message.append( getString(stationlist_obtainedby) ).append( loc.getProvider() ).append("\n"); |
message.append( getString(stationlist_obtainedby) ).append( loc.getProvider() ).append("\n"); |
269 |
message.append( getString(stationlist_accuracy) ).append( (int)loc.getAccuracy()).append("m\n"); |
message.append( getString(stationlist_accuracy) ).append( (int)loc.getAccuracy()).append("m\n"); |
270 |
message.append( getString(stationlist_latitude) ).append( (float)loc.getLatitude()).append("\n"); |
message.append( getString(stationlist_latitude) ).append( (float)loc.getLatitude()).append("\n"); |
271 |
message.append( getString(stationlist_longitude) ).append( (float)loc.getLongitude() ).append("\n"); |
message.append( getString(stationlist_longitude) ).append( (float)loc.getLongitude() ).append("\n"); |
272 |
} else { |
|
|
message.append( getString(stationlist_nolocation) ); |
|
|
} |
|
273 |
|
|
274 |
MessageBox.showMessage(this, message.toString(), false); |
MessageBox.showMessage(this, message.toString(), false); |
275 |
break; |
break; |