private void stopGroundStationTask() { DJIDrone.getDjiGroundStation() .pauseGroundStationTask( new DJIGroundStationExecuteCallBack() { @Override public void onResult(DJIGroundStationTypeDef.GroundStationResult result) { // TODO Auto-generated method stub String ResultsString = "return code =" + result.toString(); handler.sendMessage(handler.obtainMessage(SHOWTOAST, ResultsString)); DJIDrone.getDjiGroundStation() .closeGroundStation( new DJIGroundStationExecuteCallBack() { @Override public void onResult(DJIGroundStationTypeDef.GroundStationResult result) { // TODO Auto-generated method stub String ResultsString = "return code =" + result.toString(); handler.sendMessage(handler.obtainMessage(SHOWTOAST, ResultsString)); } }); } }); mGroundStationTask.RemoveAllWaypoint(); }
/** * Called when a view has been clicked. * * @param v The view that was clicked. */ @Override public void onClick(View v) { switch (v.getId()) { case R.id.locate: { updateDroneLocation(); cameraUpdate(); // Locate the drone's place break; } case R.id.add: { enableDisableAdd(); break; } case R.id.clear: { runOnUiThread( new Runnable() { @Override public void run() { aMap.clear(); } }); mGroundStationTask.RemoveAllWaypoint(); // Remove all the waypoints added to the task break; } case R.id.config: { showSettingDialog(); break; } case R.id.upload: { uploadGroundStationTask(); break; } case R.id.start: { startGroundStationTask(); mTimer.schedule(mTask, 0, 1000); break; } case R.id.stop: { stopGroundStationTask(); mTimer.cancel(); break; } case R.id.takeoff: { aircraftTakeOff(); break; } default: break; } }