Since I only changed from buttons to RecyclerView (and it worked just fine with the buttons), I know my java code is working fine, so now I face a problem because clicking a cards in the RecyclerView calls the fragment with the FragmentManager, but not showing it. Here is my activity.xml code.
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".mainSearch"
android:background="#f2f2f2">
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/recyclerView"
android:orientation="horizontal" />
</androidx.constraintlayout.widget.ConstraintLayout>
<fragment
android:name="com.diamcom.blue.StoneCodeFragment"
android:id="@+id/fragment_place"
android:layout_width="match_parent"
android:layout_height="match_parent">
</fragment>
</LinearLayout>
I wonder what am I doing wrong ?