我怎样才能申请simpleExpandableListAdapter或类似的东西的ListView在ListFragment [英] How can I apply simpleExpandableListAdapter or similar thing to ListView in ListFragment

查看:106
本文介绍了我怎样才能申请simpleExpandableListAdapter或类似的东西的ListView在ListFragment的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正与ListFragment,并希望做出一个艰难的名单,其中有子列表,不知道我能做到这一点(( 有些code:

I am working with ListFragment and want to make a difficult list, which has sublists and don't know how I can do it(( Some code:

public class CarsOfBrandFragment extends ListFragment {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ...
        String[] s = {"colorName"};
        int[] k = {R.id.groupname};
        String[] s1 = new String[]{"shadeName", "rgb"};
        int[] k1 = new int[]{R.id.childname, R.id.rgb};
        SimpleExpandableListAdapter expListAdapter = new SimpleExpandableListAdapter(getActivity(), createGroupList(),
            R.layout.grouprow, s, k, createChildList(), R.layout.childrow, s1, k1);
        setListAdapter(expListAdapter);
    }

setListAdapter(android.widget.ListAdapter)在android.support.v4.app.ListFragment不能适用于(android.widget.SimpleExpandableListAdapter)

setListAdapter(android.widget.ListAdapter) in android.support.v4.app.ListFragment cannot be applied to (android.widget.SimpleExpandableListAdapter)

推荐答案

好吧,我决定这个被明确说明 ExapndableListView 的 - 是的,我改变了对扩展平常的ListView,并使用 SimpleCursorTreeAdapter 而不是 SimpleExpandableListAdapter

Ok I decided this by explicit indicating of ExapndableListView - yes I changed usual ListView on Expandable, and using SimpleCursorTreeAdapter instead of SimpleExpandableListAdapter

这篇关于我怎样才能申请simpleExpandableListAdapter或类似的东西的ListView在ListFragment的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆