首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >How to get RadioButton in SubItem of ExpandableListView - Android

How to get RadioButton in SubItem of ExpandableListView - Android
EN

Stack Overflow用户
提问于 2013-04-24 01:20:44
回答 1查看 491关注 0票数 0

当当前视图只是如下所示的主布局视图时,如何在ExpandableListView的子项中获取自定义RadioGroup :I have- mainListView.xml //expandableListView

代码语言:javascript
复制
   - group\_row.xml    //textView 
   -child\_row.xml     //has custom radioButton
代码语言:javascript
复制
 public void onCreate(Bundle savedInstanceState) {
    try{
         super.onCreate(savedInstanceState);
         setContentView(R.layout.mainListView);

      ExpandableListView elv = (ExpandableListView) findViewById(R.id.expandableListView1);
      SimpleExpandableListAdapter expListAdapter =
                new SimpleExpandableListAdapter(
                        getApplicationContext(),
                        createGroupList(),              // Creating group List.
                        R.layout.group_row,             // Group item layout XML.
                        new String[] { "Group Item" },  // the key of group item.
                        new int[] { R.id.row_name },    // ID of each group item.-Data under the key goes into this TextView.
                        createChildList(),              // childData describes second-level entries.
                        R.layout.child_row,             // Layout for sub-level entries(second level).
                        new String[] {"Sub Item"},      // Keys in childData maps to display.
                        new int[] { R.id.grp_child}     // Data under the keys above go into these TextViews.
                    );
                elv.setAdapter(expListAdapter);       // setting the adapter in the list.

        }catch(Exception e){
               System.out.println("Errrr +++ " + e.getMessage());
        }


    answersGroup = (SegmentedRadioGroup) findViewById(need this from child_row); 
    answersGroup.setOnCheckedChangeListener(this);

}
EN

回答 1

Stack Overflow用户

发布于 2013-04-24 02:22:18

您是否可以扩展SimpleExpandableListAdapter类并重写

代码语言:javascript
复制
@Override
getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent)

来获取视图组?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16175382

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档