i have ExpandableListview
inside ScrollView
and i know that\'s not good but i had too, the only solution to show the whole list is by set its heigh
Your ListView is effectively unneeded in this case. You can as well loop over your adapter's items and just add them to a vertical LinearLayout inside your ScrollView.
In case you do not want to change a lot of code:
Replace ListView.setAdapter
with
LinearLayout ll; //this should be the vertical LinearLayout that you substituted the listview with
for(int i=0;i
If you already use an OnItemClickListener add after View v = adapter.getView(position, null, null);
the following
final int position = i;
v.setOnClickListener(new OnClickListener() {
public onClick(View v) {
yourOnItemClickListener.onItemClick(null, v, position, 0);
}
});
In this case you do not have to worry about any miscalculation in the height.