populate an expandableListView with arrayLists - android

Can anyone tell me any good links on how to do this?
I've looked through a good 15-20 links and none have really explained anything.
I just want to dynamically populate an ExpandableListView with ArrayLists or if theres
another way... I'd love to know.
PLEASE HELP :(!

I'm not sure an ArrayList is the right data structure to use for an ExpandableListView -- but if you mean a ArrayList of Maps that would be more appropriate. You could do that with the SimpleExpandableListAdapter class it looks like. Then use ExpandableListView.setAdapter() to couple it with your view.

Related

android listview of multiple types

What I want to have is a listview populated with my custom Folder class at the top, and objects at the bottom. I was thinking it would look something like it does in an OS.
I've spent hours looking through tutorials online, but the best I could find was putting an image and some text in the same row.
To be clear, I'm looking for something like this:
Folder_1
Folder_2
Folder_3
Item_1
Item_2
all in the same list.
Could anyone here help me figure this out?
The appearance of list items in a ListView is controlled by the getView() method of the list's Adapter. Any kind of customization that you want to do on a per-item basis (which includes having totally different list items) can be done from the getView() method. If you share some of the code of what you have already tried, others can help you further.

how to make the items of expandable listview check/uncheckable

I have an expandablelistview that works fine. Now I want to export the data of expandable listview and I want the user to be able to choose (or check like there be a checkbox or something) which items of listview to export. How can I do that? Can anyone give me a solution please? I have searched the net but didn't find something useful.
P.S: I have an idea, Can I place a checkbox in explistview rows and set actions to them?
Thanks so much in advance
This is not possible with a normal expandablelistview.
You have to implement the logic yourself in OnChildItemClickListener.
For an example look here: https://github.com/jiahaoliuliu/ExpandableListViewWithChoice

add a list inside of a list

I have a list of objects and when a user clicks on one of them, I want to be able to display another list of objects that are inside that first object. Does anyone know of any tutorials or advice? Thanks.
Thats probably what you are looking for: http://developer.android.com/reference/android/app/ExpandableListActivity.html
For example like this:
http://mylifewithandroid.blogspot.com/2008/05/expandable-lists.html
Or just google a bit for Tutorials for ExpandableList.

Sort expandable listview

I want to sort an expendable listview dynamically. Could someone tell me how to accomplish this?
I've tried sorting the group name but then the child elements don't get sorted.
I think we would need more details about the code, without the code it's hard to tell but anyway here is a link to some code maybe it will help you:
https://github.com/commonsguy/cwac-touchlist
Basically what I did was sort it using custom comparator methods.

Expanding List? (android)

So i want to make a list that has a number of items on the list but when a item is clicked i would like it to expand in the list to revile more information
i have done something similar with java script before but searching google isnt helping me :(
Does any one know a way i can achieve this or will i be stuck using multiple pages.
I think you are looking for Expandable listView. You can check the example here
Hope this may help u..

Categories

Resources