I have a little problem with an android custom dialog.
I construct a custom dialog in the onCreateDialog(int) function:
dialog = new Dialog(this);
di
The way round it that I use, rather than having a switch block is to use onClickListeners for the buttons:
dialog = new Dialog(this);
dialog.setContentView(R.layout.custom_dialog);
dialog.setTitle("Custom Dialog");
Button dialog_btn = (Button) dialog.findViewById(R.id.dialog_button);
dialog_btn.setOnClickListener(new View.OnClickListener()
{
// Perform button logic
}
Note that you are finding the view from the dialog, not just calling straight to findViewById as that would return a null pointer as there would be not dialog_button on the application view.