自定义对话框中的进度条

时间:2017-06-01 06:05:05

标签: java android xml android-progressbar

我想在listview中的自定义对话框中添加进度条。我的对话框是

dialog = new Dialog(RegestrationActivity.this);
    dialog.setContentView(R.layout.dialog_qulification);
    dialog.setTitle("State");
    dialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT,
            WindowManager.LayoutParams.MATCH_PARENT);
    ListViewQualification = (ListView)dialog.findViewById(R.id.ListViewQualification);

    ProgressBarStateQuali = (ProgressBar)dialog.findViewById(R.id.ProgressBarStateQuali);


        ProgressBarStateQuali.setVisibility(View.VISIBLE);
        ListViewQualification.setVisibility(View.GONE);
        ProgressBarStateQuali.setVisibility(View.GONE);
        ListViewQualification.setAdapter(adapterState);
        ListViewQualification.setVisibility(View.VISIBLE);
    dialog.show();

但它不起作用

1 个答案:

答案 0 :(得分:2)

您已将可见性设置为进度条消失,将其删除它将起作用:

     ProgressBarStateQuali.setVisibility(View.GONE);