I have an AlertDialog in which I set the layout (inside TextView and EditText) through the setView () method and placed the listView through the setMultiChoiceItems method, but when I run the dialog, the listView is displayed first and then the layout. and then ListView
LayoutInflater factoryClient = LayoutInflater.from(this); final View view=factoryClient.inflate(R.layout.dialog_layout,null); question=(TextView)view.findViewById(R.id.tv_question); ask=(EditText)view.findViewById(R.id.edit_ask); question.setText(alarm_name); String[] plans_name=getPlansName(plans_list); final boolean[] mCheckPlan=getPlanDone(plans_list); AlertDialog.Builder alert_dialog=new AlertDialog.Builder(this) .setTitle(alarm_time) .setIcon(R.mipmap.ic_dialog_time) .setView(view) .setMultiChoiceItems(plans_name, mCheckPlan, new DialogInterface.OnMultiChoiceClickListener() { @Override public void onClick(DialogInterface dialog, int which, boolean isChecked) { mCheckPlan[which] = isChecked; } }) .setCancelable(false); //закрытие диалога через кнопку назад alert_dialog.setPositiveButton("Да", null); alert_dialog.setNegativeButton("Нет", null); alert_dialog.setNeutralButton("Отложить", null); final AlertDialog alertDialog=alert_dialog.create(); alertDialog.show();