Android 学习笔记
2010-03-31 21:18:00 来源:WEB开发网核心提示: 1: // Set up a callback for the spinner 2: spnLocations.setOnItemSelectedListener( 3: new OnItemSelectedListener() { 4: public void onNothingSelected(Adapt
1: // Set up a callback for the spinner
2: spnLocations.setOnItemSelectedListener(
3: new OnItemSelectedListener() {
4: public void onNothingSelected(AdapterView<?> arg0) { }
5:
6: public void onItemSelected(AdapterView<?> parent, View v, int position,
7: long id) {
8: TextView vt = (TextView) v;
9: if ("Current Location".equals(vt.getText())) {
10: latitude = myLocation.getLatitude();
11: longitude = myLocation.getLongitude();
12: mc.animateTo(new GeoPoint((int) latitude, (int) longitude));
13: } else {
14: mc.animateTo(hmLocations.get(vt.getText()));
15: }
16: mvMap.invalidate();
17: }
18: });
更多精彩
赞助商链接