I am trying to implement a dialog box that pops up when a button is pressed by the user. This currently works, however the buttons I have included in the pop up are unresponsive. I have tried the following code to try and resolve the problem.
public void showDialog()
{
final Dialog dialog= new Dialog(context);
dialog.setContentView(R.layout.dialog_info);
infoView=(EditText) dialog.findViewById(R.id.infoView);
infoView.setFocusable(false);
infoView.setText("");
dialog.setTitle(aList.get(count).toTitle());
infoView.append(aList.get(count).toDescription());
Button back=(Button)findViewById(R.id.back);
Button reminder=(Button)findViewById(R.id.reminder);
Log.e(TAG,"Testing click 1.5");
back.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
Log.e(TAG,"Testing click 2");
dialog.dismiss();
}
});
dialog.show();
}
showDialog() gets called after a button (back) in the first view is pressed
public void onClick(View v) {
for (count =0;count<aList.size();count++)
{
if (v==buttons.get(count))
{
Log.e(TAG,"Testing click -1.1");
showDialog();
}
}
}