开发者

Android how to create a nested menulist

I want to create a menulike app where each page is a subcategory of the previous selection and the last page shows the nutrition factor of the selected item, I have already created all the arrays in the arrays.xml :

<string-array name="food_values">
<item>Veggies</item>
<item>Fruits</item>
...
<item>
</string-array> 

<string-array name="veg_values">
<item>开发者_运维技巧;Cucumber</item>
<item>Celery</item>
...
</string-array> 
<string-array name="fruit_values">
<item>Apple</item>
<item>Banana</item>
...
</string-array> 

I wanted to create a listview and use set onclicklistener to the list to open the next subcategory but I don't know how to implement it without using a lot of if and else statements and also generating the next listview with the same template list_item.xml.

I also tried Maps but it got too complicated with the nested lists.

Thank you for your help

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜