0

当当前视图只是下面显示的主布局视图时,如何在我的 ExpandableListView 的子项中访问我的自定义 RadioGroup:我有 - mainListView.xml //expandableListView
- group_row.xml //
textView -child_row.xml //has custom单选按钮

 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);

}
4

1 回答 1

0

你能扩展你的 SimpleExpandableListAdapter 类并覆盖吗

@Override
getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent)

获取视图组?

于 2013-04-23T18:22:18.080 回答