How to put ExpandableListView inside spinner in android - android

I am looking for Spinner having ExpandablelistView inside it. I want to click on the spinner view , it shows the ExpandablelistView main categories inside it, then by clicking any of the main category, the sub categories will be shown.
i found this example
spinner within expandable list view? in the child menu
i want the same ExpandablelistView but inside spinner view. i am new to android and are in the stage of learning. Any help will be heartly appreciated. Thanks

Spinner and ExpandableListview are two independent views so you can not embedded one into the other. But I have some solution for you here:
Add a spinner to main layout
Add a ExpandableListView to main layout
Then On Click/Touch event of spinner you have to show the listview on spinner's bottom.
Note: Data which you want to show in spinner then you have to show it in listview.

Related

Android Custom Spinner elements with sub child

I am looking for custom Spinner with expandable child elements. Like I want to click on the spinner view , it shows the ExpandablelistView main categories inside it, then by clicking any of the main category, the sub categories will be shown. Like reference image.
Any help would be appreciated. Thanks
Spinner and ExpandableListview are two independent views so you can not embedded one into the other. But I have some solution for you here:
1.)Add a spinner to main layout
2.)Add a ExpandableListView to main layout
3.)Then On Click/Touch event of spinner you have to show the listview on spinner's bottom.
Note: Data which you want to show in spinner then you have to show it in listview
It is just for your suggestion..

Alternate for a listview with single row

I have a ImageView with a TextView and Button. I have it currently in a custom list view, but I noticed now that I don't need to show more as one element (object). So I actually don't need a Listview to show the row (list entry). How can I show the list entry without a Listview?
You can put the elements of your custom listview item into a Layout, e.g. LinearLayout and simply add it to your activity's layout where you needed it.
You can set an OnClickListener for that layout, so user can click the whole thing.
I think you should use ListActivity. Then you can set up empty view for list. Here some tutorial: ListActivity and ListView Tips.
Also you can implement that logic with Recycler view by yourself or use library.
Here is solution from stackoverflow

How to customize ListView with ToggleButtons

I am making an android application.I have ListView in it which contains four rows having textView i.e
Hide
Unhide
Add Users
Delete users
I want to add ToggleButton in ListView for first two rows but don n't want to show it for other rows. How can i customize my ListView in this way.
Any help will be appreciated
You have to write a custom BaseAdapter. There you have the method getView() that is called for each listItem, so this is the right palce to define the layout of the listItems.
Please look at this article to ensure a smooth scrolling of your list.
And you can find a good Tutorial on Vogellas site.
If you want to add toggle button for first two rows only and not for all rows then one easy thing you can do is add in the custom listview layout file both the textview and toggle button but while implementing add (null) in the toggle button's place in the adapter for the rows for which you don't want the toggle button...

Adding a layout in a listitem

i Have custom listview like this
I have to add an another list view below Account-1 which shows rest of the accounts as shown
How can i put another Listview inside a listview only for the first item of the outer list.
Please help.

ExpandableListView within a ListView

Is it possible to have an ExpandableListView within a ListView in android? I only need one item on the list to expand.
Generally you display one or more items in listview. But there are more items for example 100 items in listview then you can use load more button in listview which display more items when user click on it. I think you refer this.

Categories

Resources