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
MainActivity
That
Menu
fragment adds anotherMenu
fragment into itsTableLayout
:fragmentManager.beginTransaction().add(R.id.tableLayout, new Menu()).commit()
Now the second
Menu
want to add some fragments into itselfTableLayout
fragmentManager.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?