本文整理汇总了Java中com.playuav.android.proxy.mission.MissionProxy.sendMissionToAPM方法的典型用法代码示例。如果您正苦于以下问题:Java MissionProxy.sendMissionToAPM方法的具体用法?Java MissionProxy.sendMissionToAPM怎么用?Java MissionProxy.sendMissionToAPM使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.playuav.android.proxy.mission.MissionProxy
的用法示例。
在下文中一共展示了MissionProxy.sendMissionToAPM方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onOptionsItemSelected
import com.playuav.android.proxy.mission.MissionProxy; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
final Drone dpApi = dpApp.getDrone();
switch (item.getItemId()) {
case R.id.menu_connect:
toggleDroneConnection();
return true;
case R.id.menu_send_mission: {
final MissionProxy missionProxy = dpApp.getMissionProxy();
if (missionProxy.getItems().isEmpty() || missionProxy.hasTakeoffAndLandOrRTL()) {
missionProxy.sendMissionToAPM(dpApi);
} else {
YesNoWithPrefsDialog dialog = YesNoWithPrefsDialog.newInstance(
getApplicationContext(), "Mission Upload",
"Do you want to append a Takeoff and RTL to your " + "mission?", "Ok",
"Skip", new YesNoDialog.Listener() {
@Override
public void onYes() {
missionProxy.addTakeOffAndRTL();
missionProxy.sendMissionToAPM(dpApi);
}
@Override
public void onNo() {
missionProxy.sendMissionToAPM(dpApi);
}
}, getString(R.string.pref_auto_insert_mission_takeoff_rtl_land_key));
if (dialog != null) {
dialog.show(getSupportFragmentManager(), "Mission Upload check.");
}
}
return true;
}
case R.id.menu_load_mission:
dpApi.loadWaypoints();
return true;
case R.id.menu_triggerCamera:
dpApi.triggerCamera();
return true;
case R.id.menu_epm_grab:
dpApi.epmCommand(false);
return true;
case R.id.menu_epm_release:
dpApi.epmCommand(true);
return true;
case android.R.id.home:
NavUtils.navigateUpFromSameTask(this);
return true;
default:
return super.onOptionsItemSelected(item);
}
}