`
ggyyleo
  • 浏览: 49658 次
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

asasassa

 
阅读更多
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); updateBtn = (Button) this.findViewById(R.id.update); sendBtn = (Button) this.findViewById(R.id.send); utc = (TextView) this.findViewById(R.id.val_UTC); dataStatus = (TextView) this.findViewById(R.id.val_data_status); currentLatitude = (TextView) this .findViewById(R.id.val_current_latitude); currentLontitude = (TextView) this .findViewById(R.id.val_current_longitude); direction = (TextView) this.findViewById(R.id.val_direction); speed = (TextView) this.findViewById(R.id.val_speed); locationlisterner = new TraceMeLocationListener(this); locationManager = (LocationManager) getSystemService(LOCATION_SERVICE); locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationlisterner); updateBtn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Location location = locationManager .getLastKnownLocation(LocationManager.GPS_PROVIDER); updateLocationInfo(location); } }); sendBtn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Location location = locationManager .getLastKnownLocation(LocationManager.GPS_PROVIDER); updateLocationInfo(location); try { sendMyLocation(location); } catch (URISyntaxException e) { e.printStackTrace(); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }); }
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics