خرید بک لینک

Vote count: 0

I have the following AlertDialog:

AlertDialogBuilder dialogBuilder = new AlertDialogBuilder(mContext);
dialogBuilder.setTitle(R.string.title);
dialogBuilder.setMessage(mContext.getString(R.string.message));
dialogBuilder.setPositiveButton(R.string.positive, new MyOnClickListener);
dialogBuilder.setNegativeButton(R.string.negative, new MyOnClickListener);
dialogBuilder.show();

with this ClickListener

public static class MyOnClickListener {
    @Override
    public void onClick(DialogInterface dialog, int which) {
      dialog.dismiss();
    }
  }

I would expect the dialog to be closed, when clicking on either of the buttons, but the dialog stays open instead.

Where am I going wrong or how can I fix this?

asked 3 mins ago

- - , .

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 3 اسفند 1394 ساعت: 19:07

صفحه بندی