本文整理汇总了Java中no.nordicsemi.android.nrftoolbox.dfu.DfuService类的典型用法代码示例。如果您正苦于以下问题:Java DfuService类的具体用法?Java DfuService怎么用?Java DfuService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DfuService类属于no.nordicsemi.android.nrftoolbox.dfu包,在下文中一共展示了DfuService类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCancel
import no.nordicsemi.android.nrftoolbox.dfu.DfuService; //导入依赖的package包/类
@Override
public void onCancel(final DialogInterface dialog) {
final LocalBroadcastManager manager = LocalBroadcastManager.getInstance(getActivity());
final Intent pauseAction = new Intent(DfuService.BROADCAST_ACTION);
pauseAction.putExtra(DfuService.EXTRA_ACTION, DfuService.ACTION_RESUME);
manager.sendBroadcast(pauseAction);
}
示例2: onCreateDialog
import no.nordicsemi.android.nrftoolbox.dfu.DfuService; //导入依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(final Bundle savedInstanceState) {
return new AlertDialog.Builder(getActivity()).setTitle(R.string.dfu_confirmation_dialog_title).setMessage(R.string.dfu_upload_dialog_cancel_message).setCancelable(false)
.setPositiveButton(R.string.yes, (dialog, whichButton) -> {
final LocalBroadcastManager manager = LocalBroadcastManager.getInstance(getActivity());
final Intent pauseAction = new Intent(DfuService.BROADCAST_ACTION);
pauseAction.putExtra(DfuService.EXTRA_ACTION, DfuService.ACTION_ABORT);
manager.sendBroadcast(pauseAction);
mListener.onCancelUpload();
}).setNegativeButton(R.string.no, (dialog, which) -> dialog.cancel()).create();
}