-1

I got this tutorial on youtube about expandablelistviews, and here is the source code that he gave, http://easyway2in.blogspot.in/2014/10/android-expandable-listview.html , problem is the contents are not arranged when the activity starts. How do i arrange the content of the listview, with the code on the link?

  • 1
    What do you mean by `the contents are not arranged` ? – Rami Sep 23 '15 at 13:59
  • Even when he adds the parent view in sequence on code. it gets jumbled up on start., Action Movies 1st, then Romantic Movies, then Horror Movies, then Comedy Movies. but when the activity starts, its not in there order when puted on code. –  Sep 23 '15 at 14:03
  • Do you mean `not in the order` you would expect? – Phantômaxx Sep 23 '15 at 14:08
  • @FrankN.Stein exactly.sorry for my bad grammar. xD –  Sep 23 '15 at 14:09
  • http://stackoverflow.com/questions/5815423/sorting-arraylist-in-alphabetical-order-case-insensitive – Phantômaxx Sep 23 '15 at 14:12

1 Answers1

0

HashMap is unordered.

This class makes no guarantees as to the order of the map; in particular, it does not guarantee that the order will remain constant over time.

Use LinkedHashMap, if you want to preserve insertion order.

Rami
  • 7,879
  • 12
  • 36
  • 66