• 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 ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Adding arraylist to an arraylist

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys greenhorn here...

I am trying to create a expandable listview inside a slide menu... I have followed a tutorial and have gotten a lot to work...

'What I would like to happen is that I want to add an employee to a FirebaseDatabase, then for the employee to be added to the Menu{with a ChildEventlistener}, but I am unable to add the the employee in time, as my Arraylist is empty when the menu is created... because it takes some time to retrieve the information from the Firebase Database..

So I was thinking: while I add the information online, why don't I add the information to a local  ArrayList, and then just populate the menu from the local arrayList...(I think this will save time? is this a good idea? my arrayList would be small, max 5 items)..

If I do it like this then I will need to add an arrayList to an arrayList in another class...

so in AddEmployeeDetails.class I have:



In MainActivity.class I create the menu with an ArrayList:the menu works if I just add random items to the ArrayList, but not if I request anything from the website, but I would like to no retrieve the items from "names" Arraylist in AddEmployeeDetails.class

MainActivity.class



I have tried: (as listed in other solutions)


Please help me... or direct me in the right direction

Thanks, Like always
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!