I have a fragment with blow layout that called Menu:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button android:id="@+id/button"/>
<TableLayout android:id="@+id/tableLayout"/>
</TableLayout>
I added it into my
MainActivityThat
Menufragment adds anotherMenufragment into itsTableLayout:fragmentManager.beginTransaction().add(R.id.tableLayout, new Menu()).commit()Now the second
Menuwant to add some fragments into itselfTableLayoutfragmentManager.beginTransaction().add(R.id.tableLayout, new MyFragment()).commit()
But that fragment adds in the first Menu.
How can I add a fragment into the second Menu fragment?