在android中,很多时候要用到确认取消弹窗,监听弹窗的确认和取消,也是经常用到的方法。
LiveHintDialog liveHintDialog = new LiveHintDialog(this);
liveHintDialog.setTitleText(getString(R.string.text_optional_stock_setting_whether_delete_stock));
liveHintDialog.setContentText("");
liveHintDialog.setLeftText(getString(R.string.cancel));
liveHintDialog.setRightText(getString(R.string.confirm));
liveHintDialog.setOnLiveHintListener(new LiveHintDialog.OnLiveHintListener() {
@Override
public void onLiveHintConfirm() {
leftTextContainer.setText(getResources().getString(R.string.text_optional_stock_setting_select_all));
}
@Override
public void onLiveHintCancel() {
}