【发布时间】:2011-08-16 06:36:23
【问题描述】:
我正在使用 ListFragment 并想制作一个困难的列表,其中包含子列表并且不知道我该怎么做(( 一些代码:
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);
}
android.support.v4.app.ListFragment中的setListAdapter(android.widget.ListAdapter)不能应用到(android.widget.SimpleExpandableListAdapter)
【问题讨论】:
-
我为此code.google.com/p/android/issues/detail?id=20973提交了功能请求,请为它投票!
-
我在这里做类似的事情 stackoverflow.com/questions/10611927/simplecursortreeadapter-and-cursorloader#comment13750623_10611927
标签: android expandablelistview android-fragments