WEB开发网
开发学院手机开发Android 开发 Android 学习笔记 阅读

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:      });

上一页  3 4 5 6 7 8 9  下一页

Tags:Android 学习 笔记

编辑录入:coldstar [复制链接] [打 印]
赞助商链接