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
what you want to do is;
alertD.show(); Button button = (Button)promptView.findViewById(R.id.buttonId); button.setOnClickListener(....)
using the view to call findViewById, rather than the activity, which will look for the id in the layout that is being displayed.
findViewById