可扩展的列表视图从威胁安卓系统中填充[关闭]。

问题描述 投票:0回答:1

嗨,我试图填充一个可扩展的列表视图从威胁蝙蝠是行不通的,当我试图扩大它,再次崩溃。

@Override
protected String doInBackground(String... arg) {
    InputStream is = null;
    String URL = arg[0];
    Log.d(LOG_TAG, "URL: " + URL);
    String res = "";

    if (arg[1].equals("Post")) {
        fpost=true;
        is = ByPostMethod(URL);
    } else {
        fpost=false;
        is = ByGetMethod(URL);
    }

    if (is != null) {
        state=true;
        res = ConvertStreamToString(is);
        Expand();
    } else {
        res = "Error de Conexion vuelva a intentarlo por favor";
    }

    return res;
}

Public void Exp () {
    expandableListView = (ExpandableListView) 
    findViewById(R.id.expandableListView);
    expandableListDetail = ExpandableListDataPump.getData();
    expandableListTitle = new ArrayList(expandableListDetail.keySet());
    expandableListAdapter = new CustomExpandableListAdapter(getApplicationContext(),
expandableListTitle, expandableListDetail);
    expandableListView.setAdapter(expandableListAdapter);
}

我审查的代码,并尝试做它onuithreat与结果感谢。

android expandablelistview
1个回答
0
投票

后面添加展开代码 expandableListView.setAdapter(expandableListAdapter);

在我的例子中,我使用 for. 那就试试这个

for (int i = 0; i < expandableListTitle.size(); i++) {
   expandableListView.expandGroup(i);
}
© www.soinside.com 2019 - 2024. All rights reserved.