Fragment transaction add/replace not working from within a fragment

If you already add HomeFrag by code, Try to change XML to this without declare <fragment/> inside

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:theme="@style/Theme.Breathe"
    android:id="@+id/mainFrag"
    tools:context=".MainActivity"/>

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top