问题描述
我正与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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!