@Override public void onClick(View v) { switch (v.getId()) { case R.id.btn_ok: onEvents.dialogOnOk(); break; case R.id.btn_cancel: onEvents.dialogOnCancel(); break; } pw.dismiss(); }
public MyDialog(OnEvents onEvents, Integer resId) { this.activity = (Activity) onEvents.getActivity(); this.onEvents = onEvents; inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE); this.resId = resId; }