public class PubItemView extends RelativeLayout{ ..... public PubItemView(Context context) { this(context, null); } public PubItemView(Context context, AttributeSet attrs) { this(context, attrs, 0); } .... @OnClick(R.id.buttonReport) public void openReport() { ReportDialogFrg fr = new ReportDialogFrg(); Bundle args = new Bundle(); args.putSerializable(ReportDialogFrg.PUBLICATION_KEY, pub); fr.setArguments(args); fr.show((NearestFrg)getActivity().getFragmentManager(), null);//тут проблема } } If I were in a fragment then
fr.show(getActivity().getFragmentManager(), null); //для фрагмента работает How to call the fr fragment from PubItemView?