欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  移动技术

2020-09-22

程序员文章站 2022-06-24 19:08:16
因为需要用到server 弹出dialog 获取系统级别的dialog .网上百度一直百度,后来发现是参数错了,记录一下 android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(getContext()); builder.setPositiveButton("确定", new DialogInterface....

因为需要用到server 弹出dialog 获取系统级别的dialog .网上百度一直百度,后来发现是参数错了,记录一下

 

  1.   android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(getContext());
                        builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialogInterface, int i) {
    //                MyService.this.stopSelf();
                                //                                if (windowManager != null) windowManager.removeView(view);
                            }
                        });
                        AlertDialog dialog = builder.create();
                        dialog.setMessage("我的计数");
                        dialog.setTitle("提示");
                        dialog.getWindow().setType( WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
                        dialog.show();

本文地址:https://blog.csdn.net/u013721227/article/details/108739082

相关标签: android