相关疑难解决方法(0)

避免将null作为视图根传递(需要解析膨胀布局的根元素上的布局参数)

为root studio传递null给了我这个警告:

避免将null作为视图根传递(需要解析膨胀布局的根元素上的布局参数)

它显示为空值getGroupView.请帮忙.

public class ExpandableListAdapter extends BaseExpandableListAdapter {

    private Context _context;
    private List<String> _listDataHeader; // header titles
    // child data in format of header title, child title
    private HashMap<String, List<String>> _listDataChild;

    public ExpandableListAdapter(Context context, List<String> listDataHeader,
                                 HashMap<String, List<String>> listChildData) {
        super();
        this._context = context;
        this._listDataHeader = listDataHeader;
        this._listDataChild = listChildData;
    }

    @Override
    public Object getChild(int groupPosition, int childPosititon) {
        return this._listDataChild.get(this._listDataHeader.get(groupPosition))
                .get(childPosititon);
    }

    @Override
    public long getChildId(int groupPosition, int childPosition) {
        return childPosition;
    }

    @Override
    public …
Run Code Online (Sandbox Code Playgroud)

android warnings android-layout layout-inflater

218
推荐指数
6
解决办法
8万
查看次数