• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

How to integrate XML files in menu?  RSS feed

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im a developing an app for a restaurant in Android Studio
I want to add the restaurant's menu in the app.
For this I created a menu in the app.
When you click on the three dots, you can see the titles of the menu
for example: pizza, dessert, ...
I made for every title an xml file with all the items of the menu.
How can I make the app show me the xml file "dessert.xml" when i click
on the title "Dessert".
How do I integrate the xml files??
Saloon Keeper
Posts: 5328
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wouldn't create an extra XML for each case, but use the built-in array handling facilities for this. So your arrays.xml file might look like this:

Then you can access them like context.getResources().getStringArray(R.array.pizza), and display them in a dialog, somewhat like https://acomputerengineer.wordpress.com/2018/07/23/display-list-in-alertdialog-in-androidsimple-list-radio-button-list-check-box-list/
These are the worst of times and these are the best of times. And this is the best tiny ad:
global solutions you can do at home or in your backyard
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!