Answer the question
In order to leave comments, you need to log in
How to make a menu in Android applications?
Hello. I am developing one of the first Android applications. Something like a city directory. There is a list (Museums, Parks, Attractions) In each of these lists there is another list. (Central Park, Culture Park, etc.). Then, by selecting the Park of Culture, the menu Description, photo, info, etc. appears. So. At this stage, for each of the menus, I make my own layout, and an adapter, as well as xml-with data-itemo's names. Thus, if I have three menus (Main-> Sub-menu-> Details), then I get three adapters that take information and supply it to the activity, as well as 3 + 3 + 3 = 9 layouto's I somehow confuse such a number files with such a small application. Is it possible to do something, if it is several menus consisting of lists (listView), then dynamically load the corresponding menu, depending on the selected element? Maybe some links, examples, patterns?
At the moment, for the first menu, I have an XML file that stores data in this form
<?xml version="1.0" encoding="utf-8"?>
<Menu>
<mainMenuData>
<id>1</id>
<itemName>Туры</itemName>
<icon>tours</icon>
</mainMenuData>
<mainMenuData>
<id>2</id>
<itemName>Музеи</itemName>
<icon>museums</icon>
</mainMenuData>
<mainMenuData>
<id>3</id>
<itemName>Достопримечательности</itemName>
<icon>monuments</icon>
</mainMenuData>
</Menu>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question