window悬浮窗中选择框

    

 

    AlertDialog.Builder builder = new AlertDialog.Builder(FireWallService.this);
                    
                    builder.setTitle("请选择举报类型") // title
                    .setItems(R.array.stype, new DialogInterface.OnClickListener() { //content
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            
                            //实现
                            
                        }});
                    AlertDialog ad = builder.create();
                    //ad.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG); //系统中关机对话框就是这个属性
                    ad.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
                    ad.setCanceledOnTouchOutside(false);                                   //点击外面区域不会让dialog消失
                    ad.show();

 
posted @ 2015-07-13 17:20  辛苦搬砖  阅读(146)  评论(0)    收藏  举报