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; }