简体   繁体   中英

how can I have several xml files to be invoked below one main menu and I don't utilize Fragments at the same time?

I have some Layouts from top to bottom of display of an Android device as following:

1 - Layout1: Height 2cm,it is Horizontal Linear Layout
This is the main Layout (menu) with some items which are horizontally sorted one by one and the users of The application can select the item of interest by clicking on that item, the items are named as Item1, Item2, Item3, ...

2 - Layout2: Height 3cm,it is Horizontal Linear Layout
This layout is below the Lauout1 and it appears when the Item1 of the Layout1 is clicked

3 - Layout3: Height 4cm,it is Horizontal Linear Layout
This layout is below the Lauout1 and it appears when the Item2 of the Layout1 is clicked

So when the Item1 is clicked, we have Layout2 below the Layout1 and when the Item2 is clicked, we have Layout3 below the Layout1

The Question:
For some reasons, I don't want to utilize Fragments to be used below Layout1 so that when an item of Layout1 is clicked then the related Fragment be invoked with its own xml file
So what can I do in replace?
In other words, how can I have several xml files to be used below the main Layout and I don't utilize Fragments?

Try this in the main.xml file to import other xml file in it.

 <include
        android:id="@+id/layout2"
        layout="@layout/layout_2" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM