本文整理汇总了Java中android.content.DialogInterface.cancel方法的典型用法代码示例。如果您正苦于以下问题:Java DialogInterface.cancel方法的具体用法?Java DialogInterface.cancel怎么用?Java DialogInterface.cancel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.content.DialogInterface
的用法示例。
在下文中一共展示了DialogInterface.cancel方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: system_message_popup
import android.content.DialogInterface; //导入方法依赖的package包/类
/**Pop up error message to display lengthy message, this can be used to display error message as well*/
public void system_message_popup(String popup_title, String popup_message, String popup_buttonMessage)
{
DialogInterface.OnClickListener errMessageClickListener = new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialogInterface, int i)
{
dialogInterface.cancel();
}
};
popUpWindow = new AlertDialog.Builder(context);
popup_textView = new TextView(context);
popUpWindow.setTitle(popup_title);
popup_textView.setText(popup_message);
popUpWindow.setPositiveButton(popup_buttonMessage, errMessageClickListener);
popUpWindow.setView(popup_textView);
popUpWindow.show();
}
示例2: onClick
import android.content.DialogInterface; //导入方法依赖的package包/类
/**
* Listens for user's actions.
* @param dialog Current instance of dialog.
* @param which Id of pressed button.
*/
@Override
public void onClick(DialogInterface dialog, int which) {
switch (which) {
//If user presses positive button
case DialogInterface.BUTTON_POSITIVE:
//Check if user gave us a listener
if (mOnDateSetListener != null)
//Set picked year and month to the listener
mOnDateSetListener.onYearMonthSet(mYear, mMonth);
break;
//If user presses negative button
case DialogInterface.BUTTON_NEGATIVE:
//Exit the dialog
dialog.cancel();
break;
}
}
示例3: createCameraAlertDialog
import android.content.DialogInterface; //导入方法依赖的package包/类
public static final Dialog createCameraAlertDialog(final Context context, int titleId, int messageId, int posiBtntextId){
CustomDialog r = new CustomDialog(context);
r.setTitle(titleId);
r.setMessage(messageId);
DialogInterface.OnClickListener onClickListener = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
switch (which) {
case DialogInterface.BUTTON_POSITIVE:
dialog.cancel();
break;
}
}
};
r.setPositiveButton(posiBtntextId, onClickListener);
r.setCancelable(false);
return r;
}
示例4: onKey
import android.content.DialogInterface; //导入方法依赖的package包/类
/**
* Resets image on {@literal KeyEvent.KEYCODE_BACK} to normal scale if needed, otherwise - hide the viewer.
*/
@Override
public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK &&
event.getAction() == KeyEvent.ACTION_UP &&
!event.isCanceled()) {
if (viewer.isScaled()) {
viewer.resetScale();
} else {
dialog.cancel();
}
}
return true;
}
示例5: onClick
import android.content.DialogInterface; //导入方法依赖的package包/类
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.cancel();
}
示例6: onClick
import android.content.DialogInterface; //导入方法依赖的package包/类
public void onClick(DialogInterface dialogInterface, int i) {
this.a.z = null;
this.a.a(false);
dialogInterface.cancel();
}