How can can I add custom buttons into an AlertDialog's layout?

后端 未结 6 889
误落风尘
误落风尘 2020-12-09 08:48

I have AlertDialog with Positive and Negative buttons. In AlertDialog layout I have EditText and two Buttons (btnAdd1, btnAdd2). I want when user click at the Button btnAdd1

6条回答
  •  粉色の甜心
    2020-12-09 09:33

    You could try something like this :

    dialog.setPositiveButton(R.string.positive, new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            dialog.show();
        }
    });
    

提交回复
热议问题