package com.newingscom.fpimlockscreen;import android.app.AlertDialog;import android.content.Context;import android.content.DialogInterface;import android.view.View;/** * Created by Administrator on 2019/4/1 0001. */public class MSDialogManager {    private static MSDialogManager msDialogManager = new MSDialogManager();    private AlertDialog alertDialog;    public static MSDialogManager newInstance() {        return msDialogManager;    }    public void showDialog(Context context) {        if (alertDialog == null) {            AlertDialog.Builder builder = new AlertDialog.Builder(context, R.style.MyDialog);            View alView = View.inflate(context, R.layout.dialog_lockscreen_lock_remind, null);            builder.setView(alView);            alertDialog = builder.create();            alertDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {                @Override                public void onDismiss(DialogInterface dialogInterface) {                    alertDialog = null;                }            });        }        alertDialog.show();    }    public void dismissDialog() {        if (alertDialog != null) {            alertDialog.dismiss();            alertDialog = null;        }    }}
  
        

更多相关文章

  1. Android(安卓)APP--建立简单的交互界面
  2. 进度条及拖动条背景颜色设置(progressDrawable)
  3. tools:context =“activityname”布局文件中定activity的渲染上
  4. android gridview按钮边框和定制点击颜色
  5. android 如何在对话框中获取edittext中的数据
  6. android 按钮Button单击背景切换
  7. 【android】设置View字体点击变色和边框背景设置
  8. (20120808)(01)android菜单与对话框--之日期及时间选择对话框
  9. android中改变标题栏的背景色

随机推荐

  1. c语言最小生成树的实现
  2. .Net Core如何读取Json配置文件
  3. java与c哪个简单?
  4. .NET中async异步、thread多线程
  5. c++换行符有哪些
  6. c++如何实现字符串分割函数split?(代码示例
  7. c语言是一种什么编译形式的语言
  8. 深入了解数组、List和ArrayList的区别
  9. c++怎么运行
  10. 浅谈C#方法的六种参数