I have an activity which contain two Fragment
, now I want them invisible when the Activity
is created, I will show the Fragment according to the user input.
So I tried to set the Fragment
invisbile in the layout file:
<fragment
android:name="com.app.ui.ArticleListFragment"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:id="@+id/poiSearchFrag"
android:visibility="gone"></fragment>
<fragment
android:name="com.app.ui.ArticleReaderFragment"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:id="@+id/routeSearchFrag"
android:visibility="gone"></fragment>
But it seems that this does not work.
How to fix it?