Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Adding arraylist to an arraylist

Ranch Hand
Posts: 51
  • 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


I have tried: (as listed in other solutions)

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

Thanks, Like always
My previous laptop never exploded like that. Read this tiny ad while I sweep up the shards.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic