Creating buttons in expandablelistview
My Question is
I have a expandable list 开发者_运维技巧view. in the expandable list i have two buttons in each child in the list. Now i can able to add buttons in the child list. But i dont know how to get parent position and child position. with this parent and child values i need to call another activity. I dont know how to use expandablelistadapter and onChildClick method. Can anybody explain with example. Because am new to android.
You wont get source code implementation as this is not a "gimme-teh-codez" website. Please try to ask questions more specific or tell us whats the problem with your source-code. You can use pastebin.com to direct us to your source code.
I shall point to some links that will help you get started:
Check out : An example showing how to use the child position and ExpandableListAdapter
Expandable lists have groups which contain children
The solution won't differ from simple ListViews, so you can take a look at something like this article. Basically, when you define your views in getView() (or in case of expandable lists in getChildView()), you define click listeners for the buttons with setOnClickListener(). You use the button's setTag() method to set necessary information like its position and then read it inside the listener with getTag().
精彩评论