title: ListView inside ViewPager not scrolling
body: <p>I have a <code>ViewPager</code> in my activity. I use <code>Fragment</code> to display a list into <code>ViewPager</code>. In <code>ViewPager</code> I can set a <code>ListView</code>. <code>ListView</code> can display properly but <code>ListView</code> is not scrolling. So few item in list cannot be shown.</p>
  
  <p>How can I solve it.</p>
  
  <p><strong>MainActivity</strong></p>
  
  <pre><code>public class MainActivity extends Activity {
  
  private PageAdapter mSectionsPagerAdapter;
  private ViewPager mViewPager;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
      TextView mTitle = (TextView) toolbar.findViewById(R.id.toolbar_title);
  
      setSupportActionBar(toolbar);
      // Create the adapter that will return a fragment for each of the three
      // primary sections of the activity.
      mSectionsPagerAdapter = new PageAdapter(getSupportFragmentManager(), 3);
  
      // Set up the ViewPager with the sections adapter.
      mViewPager = (ViewPager) findViewById(R.id.container);
      mViewPager.setAdapter(mSectionsPagerAdapter);
  
      TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
      tabLayout.setupWithViewPager(mViewPager);
  
      System.out.println(tabLayout.getTabCount());
     /* for (int i = 0; i &lt; tabLayout.getChildCount(); i++) {
          tabLayout.getChildAt(i).setBackgroundResource(R.drawable.tab_background_select);
      }*/
  
      mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
          @Override
          public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
  
          }
  
          @Override
          public void onPageSelected(int position) {
              Fragment j = mSectionsPagerAdapter.getItem(position);
              if (j instanceof Downloads) {
                  ((Downloads) j).refresh();
              }
          }
  
          @Override
          public void onPageScrollStateChanged(int state) {
  
          }
      });
      File folder = new File(Const.APP_folder);
      boolean success = true;
      if (!folder.exists()) {
          folder.mkdir();
      }
  }
  
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.menu_main, menu);
      return true;
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      // Handle action bar item clicks here. The action bar will
      // automatically handle clicks on the Home/Up button, so long
      // as you specify a parent activity in AndroidManifest.xml.
      int id = item.getItemId();
  
      //noinspection SimplifiableIfStatement
      if (id == R.id.action_settings) {
          return true;
      }
  
      return super.onOptionsItemSelected(item);
  }
  
  /**
  * A placeholder fragment containing a simple view.
  */
  public static class PlaceholderFragment extends Fragment {
  
  /**
   * Declare ListView .
   */
  ListView lv;
  
  public PlaceholderFragment() {
  }
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
      View rootView = inflater.inflate(R.layout.fragment_main, container,    false);
  
      /**
       * Inititlize.
       */
      lv = (ListView) rootView.findViewById(R.id.listView);
  
      return rootView;
  }
  
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
      super.onActivityCreated(savedInstanceState);
  
      List&lt;String&gt; lst = new ArrayList&lt;String&gt;();
      for(int i = 1; i &lt;= 10; i++) {
          lst.add(i + "");
      }
  
      ArrayAdapter&lt;String&gt; ArAd = new ArrayAdapter&lt;String&gt;(getActivity(),
              android.R.layout.simple_list_item_1, lst);
      lv.setAdapter(ArAd);
  
  }
  
  }
  
  }
  </code></pre>
  
  <p>here is my listview xmlfile</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:tools="http://schemas.android.com/tools"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   tools:context="com.app.down.fragments.PlaceholderFragment"&gt;
  
  &lt;ListView
      android:id="@+id/listView"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:divider="@android:color/transparent"
      android:dividerHeight="0dp" /&gt;
   &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>Mainactivity.xml</strong></p>
  
  <pre><code>&lt;android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  android:id="@+id/main_content"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="@drawable/bg"
  android:fitsSystemWindows="true"
  tools:context="com.app.down.MainActivity"&gt;
  
  &lt;android.support.design.widget.AppBarLayout
      android:id="@+id/appbar"
      style="@style/HeaderBar"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:paddingTop="@dimen/appbar_padding_top"
      android:theme="@style/AppTheme.AppBarOverlay"&gt;
  
      &lt;android.support.v7.widget.Toolbar
          android:id="@+id/toolbar"
          android:layout_width="match_parent"
          android:layout_height="?attr/actionBarSize"
          app:layout_scrollFlags="scroll|enterAlways"
          app:popupTheme="@style/AppTheme.PopupOverlay"&gt;
  
          &lt;TextView
              android:id="@+id/toolbar_title"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center"
              android:text="Home"
              android:textColor="#efe6c7"
              android:textSize="30dp" /&gt;
  
  
      &lt;/android.support.v7.widget.Toolbar&gt;
  
      &lt;android.support.design.widget.TabLayout
          android:id="@+id/tabs"
          style="@style/MyCustomTabLayout"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_margin="@dimen/activity_horizontal_margin"
          android:background="@drawable/tab_main_border"
          app:tabBackground="@drawable/tab_background_select" /&gt;
  
  &lt;/android.support.design.widget.AppBarLayout&gt;
  
  &lt;android.support.v4.view.ViewPager
      android:id="@+id/container"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      app:layout_behavior="@string/appbar_scrolling_view_behavior" /&gt;
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>