You are getting data from server in async task and immediately after calling async task yor are assigning data to your adapter which is wrong.
Your code:
new GetData().execute();
// Collections.addAll(lst, "abc","bc");
// Collections.addAll(sublst,"pass","v");
cd=new CustomAdapter(Data.this, lst, sublst);//you will not get data here...
lv.setAdapter(cd);
make sure that you create your adapter object in post exeute of aysnc task.
@Override
protected void onPostExecute(String result) {
// TODO Auto-generated method stub
super.onPostExecute(result);
cd=new CustomAdapter(Data.this, lst, sublst);//add this line
lv.setAdapter(cd);//add this line
Toast.makeText(Data.this,"Progress",Toast.LENGTH_LONG).show();
tv.setText(z+"ab");
}
1
solved Why data from server is not coming in the form of listview?