title: Android ListView not scrolling due to use of Fragment instead of ListFragment
body: <p>I had set up an Activity and a Fragment, and in the layout I had a ListView, which I gave an arbitrary name and accessed via findViewById(). All was working fine, until I noticed that scrolling didn't work for the ListView.</p>
  
  <p>There are many threads here on SO about ListView and lack of scrolling. I used much more time than I care to admit trying out one possible solution after another. Nothing worked, until I stumbled upon the solution, which I'll describe in an answer to this question.</p>
  
  <p>EDIT:</p>
  
  <p>I've deleted the answer I posted to my own question, where I claimed that you had to use ListFragment (or SherlockListFragment) to get scrolling of a ListView to work.</p>
  
  <p>Thanks to Zackehh9lives I've determined that I was wrong in that claim.</p>
  
  <p>The key phrase in his answer is that the stump of code he shows is in the onCreateView() method. After some experimenting, I think the situation is as follows:</p>
  
  <p>If you use ListFragment (or SherlockListFragment) you have to set up the ListView widget in the onActivityCreated() method, and ListView scrolling works.</p>
  
  <p>If you use Fragment (or SherlockFragment) you can set up ListView in onActivityCreated() or in onCreateView(), but if you do it in onActivityCreated() then scrolling doesn't work.</p>
  
  <p>That was my problem - I was using SherlockFragment and setting up ListView in onActivityCreated().</p>