如何在service中显示对话框dialog
来源:互联网 发布:python 入门教程 编辑:程序博客网 时间:2024/05/17 07:45
AlertDialog.Builder b = new AlertDialog.Builder(StatusBarService.this); b.setView(view); final AlertDialog d = b.create(); d.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG); //系统中关机对话框就是这个属性 //d.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT); //窗口可以获得焦点,响应操作 //d.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY); //窗口不可以获得焦点,点击时响应窗口后面的界面点击事件 d.show(); Button yesButton = (Button) view.findViewById(R.id.yes_button); Button canclButton = (Button) view.findViewById(R.id.cancl_button); yesButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(Intent.ACTION_REQUEST_SHUTDOWN); intent.putExtra(Intent.EXTRA_KEY_CONFIRM, false); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); } }); canclButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { d.dismiss(); } });
0 0
- 如何在service中显示对话框dialog
- Android如何在service中显示Dialog
- 如何在service中显示Dialog
- 如何在服务(Service)程序中显示对话框
- 如何在服务(Service)程序中显示对话框(转贴)
- 如何在服务(Service)程序中显示对话框
- 如何在服务(Service)程序中显示对话框
- 如何在服务(Service)程序中显示对话框
- Android在Service中显示Dialog
- Android在Service中显示Dialog
- service中显示Dialog
- Android 在服务Service中创建Dialog对话框
- android在Service中弹出Dialog对话框
- Android在Service中弹出对话框(Dialog)
- service中显示一个dialog
- service中显示一个dialog
- service中显示一个dialog
- service中显示一个dialog
- Codeforces Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined)
- 数据库事务隔离级别
- 【WebGL】WebGL的坐标系统
- MAC下 JDK环境配置、版本切换以及ADB环境配置
- OC与JS之间的交互
- 如何在service中显示对话框dialog
- BAPI_LAYMOD_SAVEREPLICA
- java数据结构和算法(StringUtil)
- C++设计模式——简单工厂模式
- Android中:Activity、Content Provider、Broadcast和AIDLService4种跨历程通讯的方式
- 图像处理与计算机视觉的论文创新点总结
- php7新特性
- 如何使用java版张华平分词软件
- doxygen 生成源码文档