本文整理汇总了Java中android.app.Dialog.isShowing方法的典型用法代码示例。如果您正苦于以下问题:Java Dialog.isShowing方法的具体用法?Java Dialog.isShowing怎么用?Java Dialog.isShowing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.app.Dialog
的用法示例。
在下文中一共展示了Dialog.isShowing方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showDialog
import android.app.Dialog; //导入方法依赖的package包/类
private void showDialog(Dialog dlg) {
if (dlg != null) {
try {
if (dlg.isShowing()) {
dlg.cancel();
} else {
dlg.show();
}
} catch (Exception e) {
}
}
}
示例2: dismiss
import android.app.Dialog; //导入方法依赖的package包/类
/**
* 关闭弹出框
*/
public static void dismiss(DialogInterface... dialogs) {
if (dialogs != null && dialogs.length > 0) {
for (DialogInterface dialog : dialogs) {
if (dialog instanceof Dialog) {
Dialog dialog1 = (Dialog) dialog;
if (dialog1.isShowing()) {
dialog1.dismiss();
}
} else if (dialog instanceof AppCompatDialog) {
AppCompatDialog dialog2 = (AppCompatDialog) dialog;
if (dialog2.isShowing()) {
dialog2.dismiss();
}
}
}
}
}
示例3: dismiss
import android.app.Dialog; //导入方法依赖的package包/类
/**
* 关闭弹出框
*/
public static void dismiss(DialogInterface... dialogs) {
if (dialogs != null && dialogs.length > 0) {
for (DialogInterface dialog : dialogs) {
if (dialog instanceof Dialog) {
Dialog dialog1 = (Dialog) dialog;
if (dialog1.isShowing()) {
dialog1.dismiss();
}
} else if (dialog instanceof AppCompatDialog) {
AppCompatDialog dialog2 = (AppCompatDialog) dialog;
if (dialog2.isShowing()) {
dialog2.dismiss();
}
}
}
}
}
示例4: showLoading
import android.app.Dialog; //导入方法依赖的package包/类
public LoadingView showLoading(CharSequence msg, boolean cancleabl) {
mDialog = new Dialog(mContext);// TODO: 2017/8/28 内存泄露时这里也修改为弱引用
mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
rootView = View.inflate(mContext, R.layout.dialogui_loading_horizontal, null);
mLinearLayout = (LinearLayout) rootView.findViewById(R.id.dialogui_ll_bg);
mProgressBar = (ProgressBar) rootView.findViewById(R.id.pb_bg);
mTextView = (TextView) rootView.findViewById(R.id.dialogui_tv_msg);
mTextView.setText(msg);
mLinearLayout.setBackgroundResource(R.drawable.dialogui_shape_wihte_round_corner);
mProgressBar.setIndeterminateDrawable(mContext.getResources().getDrawable(R.drawable.dialogui_shape_progress));
mTextView.setTextColor(mContext.getResources().getColor(R.color.text_black));
mDialog.setContentView(rootView);
if (mDialog != null) {
if (mDialog.isShowing()) {
mDialog.dismiss();
}
mDialog.setCancelable(cancleabl);
mDialog.setOnCancelListener(this);
mDialog.show();
}
return this;
}
示例5: showDialog
import android.app.Dialog; //导入方法依赖的package包/类
private void showDialog(Dialog dlg) {
if (dlg != null) {
if (dlg.isShowing()) {
dlg.cancel();
} else {
dlg.show();
}
}
}
示例6: onSaveInstanceState
import android.app.Dialog; //导入方法依赖的package包/类
@Override protected Parcelable onSaveInstanceState() {
final Parcelable superState = super.onSaveInstanceState();
Dialog dialog = getDialog();
if (dialog == null || !dialog.isShowing()) {
return superState;
}
final SavedState myState = new SavedState(superState);
myState.isDialogShowing = true;
myState.dialogBundle = dialog.onSaveInstanceState();
return myState;
}
示例7: dismissDialog
import android.app.Dialog; //导入方法依赖的package包/类
private void dismissDialog(Dialog dialog) {
if (dialog == null)
return;
if (dialog.isShowing()) {
dialog.dismiss();
}
}
示例8: onSaveInstanceState
import android.app.Dialog; //导入方法依赖的package包/类
@Override
protected Parcelable onSaveInstanceState() {
final Parcelable superState = super.onSaveInstanceState();
final Dialog dialog = getDialog();
if (dialog == null || !dialog.isShowing()) {
return superState;
}
final SavedState myState = new SavedState(superState);
myState.mSubtype = mSubtype;
return myState;
}
示例9: dismiss
import android.app.Dialog; //导入方法依赖的package包/类
/**
* Tries to dismiss the given {@link Dialog}.
*
* @param dialog Which dialog to dismiss
* @return {@code True} if the given dialog is not {@code null}, it is currently showing and dismiss was invoked; {@code false}
* otherwise
*/
public static boolean dismiss(@Nullable final Dialog dialog) {
if (dialog != null && dialog.isShowing()) {
dialog.dismiss();
return true;
} else {
return false;
}
}
示例10: releaseDialogList
import android.app.Dialog; //导入方法依赖的package包/类
/**
*
*/
private void releaseDialogList() {
if(mAppDialogCache == null) {
return;
}
for(Dialog dialog : mAppDialogCache) {
if(dialog == null || !dialog.isShowing()) {
continue;
}
dialog.dismiss();
}
mAppDialogCache.clear();
mAppDialogCache = null;
}
示例11: safeShowDialog
import android.app.Dialog; //导入方法依赖的package包/类
/**
* 显示Dialog
*/
public static void safeShowDialog(Dialog dialog) {
try {
if (dialog != null && !dialog.isShowing()) {
dialog.show();
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例12: closeDialog
import android.app.Dialog; //导入方法依赖的package包/类
/**
* 关闭dialog
*
* @param mDialogUtils
*/
public static void closeDialog(Dialog mDialogUtils) {
if (mDialogUtils != null && mDialogUtils.isShowing()) {
mDialogUtils.dismiss();
}
}
示例13: toDismissDialog
import android.app.Dialog; //导入方法依赖的package包/类
protected void toDismissDialog(Dialog dialog) {
if (dialog != null && dialog.isShowing()) {
dialog.dismiss();
}
}
示例14: toShowDialog
import android.app.Dialog; //导入方法依赖的package包/类
protected void toShowDialog(Dialog dialog) {
if (dialog != null && !dialog.isShowing()) {
dialog.show();
}
}
示例15: closeDialog
import android.app.Dialog; //导入方法依赖的package包/类
/**
* 关闭dialog
*
* http://blog.csdn.net/qq_21376985
*
* @param mDialogUtils
*/
public static void closeDialog(Dialog mDialogUtils) {
if (mDialogUtils != null && mDialogUtils.isShowing()) {
mDialogUtils.dismiss();
}
}