title: android-ListView inside scrollView not working properly
body: <p>I've to use listView inside a scrollView , for some reasons I can't use addHeader for addFooter .</p>
  
  <p>When I set adapter to my listView , I change it heights but it's not working properly . </p>
  
  <p>This is my code :</p>
  
  <pre><code>lv.setAdapter(ladap);
                      int totalHeight = 0;
                      for (int size = 0; size &lt; ladap.getCount(); size++) {
                          View listItem = ladap.getView(size, null, lv);
                          listItem.measure(0, 0);
                          totalHeight += listItem.getMeasuredHeight();
                      }
                      ViewGroup.LayoutParams params = lv.getLayoutParams();
                      params.height = totalHeight + (lv.getDividerHeight() * (ladap.getCount() - 1));
                      lv.setLayoutParams(params);
                      lv.requestLayout();
  </code></pre>
  
  <p>This is the result :</p>
  
  <p><img src="https://i.stack.imgur.com/5MZgH.jpg" alt="enter image description here"></p>
  
  <p>as you can see,  the listview is finished in the middle of the page but it still scrolls alot .</p>
  
  <p>How to make it right ?</p>