How can I call a fragment from the MainActivity by pressing a button.
Fragment itself.
public class EventInterestFragment extends DialogFragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.activity_event_interests, container, false); } } and what you need to enter here to call \ display a fragment with an XML file)
public void btn_click (View v) { Реализация по вызову фрагмента. }
And you can please implementation. Thank you in advance.