fragment placehoder in layout

It is possible. In your main.xml, define a place holder for the fragment, let's call it "fragment_placeholder":

<LinearLayout ...>
 <FrameLayout android:id="@+id/fragment_placeholder" android:layout_weight="1"
        android:layout_width="0px"
        android:layout_height="match_parent" />
</LinearLayout>

In your activity, whenever you want to load your fragment:

YourFragment fragment = new YourFragment();
FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.replace(R.id.fragment_placeholder, fragment);
ft.commit();

You can also use FragmentContainerView. From the documentation:

FragmentContainerView is a customized Layout designed specifically for Fragments. It extends FrameLayout, so it can reliably handle Fragment Transactions, and it also has additional features to coordinate with fragment behavior.

Example (also from the docs):

<androidx.fragment.app.FragmentContainerView
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/fragment_container_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
 </androidx.fragment.app.FragmentContainerView>