我的Android成长之路(13)----自定义dialog

private void showDialog(){
        RelativeLayout layout = (RelativeLayout) LayoutInflater.from(mContext).inflate(R.layout.dialog_gzjd,null);
        final AlertDialog dialog = new AlertDialog.Builder(mContext).create() ;
        dialog.show();
        dialog.getWindow().setContentView(layout);
        ImageView close = (ImageView) layout.findViewById(R.id.gzjd_dialog_close);
        close.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
            }
        });
        TextView title = (TextView) layout.findViewById(R.id.gzjd_dialog_title);
        title.setText("工作进度");
        ListView list = (ListView) layout.findViewById(R.id.gzjd_dialog_list);
        GzjdAdapter jdAdapter = new GzjdAdapter(mContext) ;
        list.setAdapter(jdAdapter);
        List> data = new ArrayList<>() ;
        data.add(new HashMap()) ;
        data.add(new HashMap()) ;
        data.add(new HashMap()) ;
        jdAdapter.setData(data);
        jdAdapter.notifyDataSetChanged();
    }

 
  
 
  
 
 

你可能感兴趣的:(Android)