title: listview in fragment doesn't scroll
body: <p>i have have a tabular content in my activity that has 3 tab and each tab content has a fragment and named them OneFragment, TwoFragment and ThirdFragment
  now in my TwoFragment class that handle my second tab content, it has a listview control.</p>
  
  <p>now the problem:
   <strong>i don't know why the list control doesn't scroll!!</strong></p>
  
  <p>here is my activity code: call it foot_recipe class</p>
  
  <pre><code>package com.example.android.dezcook;
  
  import android.content.ContentValues;
  import android.content.Context;
  import android.content.Intent;
  import android.database.Cursor;
  import android.database.SQLException;
  import android.database.sqlite.SQLiteDatabase;
  import android.os.Bundle;
  
  import android.support.design.widget.FloatingActionButton;
  import android.support.design.widget.Snackbar;
  import android.support.design.widget.TabLayout;
  import android.support.v4.app.Fragment;
  import android.support.v4.app.FragmentManager;
  import android.support.v4.app.FragmentPagerAdapter;
  import android.support.v4.view.ViewPager;
  import android.support.v7.app.AppCompatActivity;
  import android.support.v7.widget.Toolbar;
  import android.util.Log;
  import android.view.View;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import java.io.IOException;
  import java.util.ArrayList;
  import java.util.List;
  
  public class Foot_recipe extends AppCompatActivity {
      /*Layout Properties define*/
      private Toolbar toolbar;
      private TabLayout tabLayout;
      private ViewPager viewPager;
      private Food send_info;
      private int[] tabIcons = {
              R.drawable.tab_details_imagealbum,
              R.drawable.tab_details_cookie,
              R.drawable.tab_details_camera
      };
      /*End layout propeties Definition*/
      /*Start Logic definition from here*/
  
      /*End Logic Definition*/
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_foot_recipe);
  
          //get data from intent sended from cardview
          String txtID = "";
          Intent intent = getIntent();
          //   Bundle bundle=intent.getExtras();
          // if(bundle!=null)txtID=bundle.getString("txtid");
          Food food = (Food) intent.getParcelableExtra("food_obj");
          send_info = food;
  
          //tool bar customization
          TextView toolbar_title = (TextView) findViewById(R.id.toolbar_title);
          toolbar_title.setText(food.getTxtName());
          toolbarCustomization();
          //Tab customization
          tabCustomization();
  
          //Customize floatting button
          ActionButton_fav(food.getTxtid());
  
      }
  
      public void ActionButton_fav(final int id) {
          FloatingActionButton fav = (FloatingActionButton) findViewById(R.id.fav_btn_heart);
          fav.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  if (addDBfav(id) &gt; 0)
                      Snackbar.make(v, "added to fav list", Snackbar.LENGTH_SHORT).show();
                  else
                      Snackbar.make(v, "not in fav list", Snackbar.LENGTH_SHORT).show();
              }
          });
      }
  
      public Food sendFrag_info() {
          return send_info;
      }
  
      /*Layout Section
      * All Layout code about food details are down side this page
      * */
      private void toolbarCustomization() {
          toolbar = (Toolbar) findViewById(R.id.foodrestoolbar);
          setSupportActionBar(toolbar);
  
          getSupportActionBar().setDisplayHomeAsUpEnabled(true);
      }
  
  
      private void tabCustomization() {
          viewPager = (ViewPager) findViewById(R.id.viewpager);
          setupViewPager(viewPager);
          tabLayout = (TabLayout) findViewById(R.id.tabs);
          tabLayout.setupWithViewPager(viewPager);
          setupTabIcons();
          tabLayout.getTabAt(2).select();
      }
  
      private void setupTabIcons() {
          tabLayout.getTabAt(0).setIcon(tabIcons[0]);
          tabLayout.getTabAt(1).setIcon(tabIcons[1]);
          tabLayout.getTabAt(2).setIcon(tabIcons[2]);
  
      }
  
      private void setupViewPager(ViewPager viewPager) {
          ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());
          adapter.addFragment(new OneFragment(), "desc");
          adapter.addFragment(new TwoFragment(), "material");
          adapter.addFragment(new ThreeFragment(), "pic");
          viewPager.setAdapter(adapter);
      }
  
      class ViewPagerAdapter extends FragmentPagerAdapter {
          private final List&lt;Fragment&gt; mFragmentList = new ArrayList&lt;&gt;();
          private final List&lt;String&gt; mFragmentTitleList = new ArrayList&lt;&gt;();
  
          public ViewPagerAdapter(FragmentManager manager) {
              super(manager);
          }
  
          @Override
          public Fragment getItem(int position) {
              return mFragmentList.get(position);
          }
  
          @Override
          public int getCount() {
              return mFragmentList.size();
          }
  
          public void addFragment(Fragment fragment, String title) {
              mFragmentList.add(fragment);
              mFragmentTitleList.add(title);
          }
  
          @Override
          public CharSequence getPageTitle(int position) {
              return mFragmentTitleList.get(position);
          }
  
      }
  
      public int addDBfav(int id) {
          SQLiteDatabase sqLiteDatabase;
          DbHelper myDbHelper = new DbHelper(this);
  /* try{
              myDbHelper.createDatabase();
          }catch (IOException e)
          {
              throw new Error("unable to create database");
      }*/
  /*        myDbHelper.openDataBase();
          sqLiteDatabase = myDbHelper.getWritableDatabase();
          Cursor cursor = sqLiteDatabase.rawQuery("UPDATE food SET fav=1 WHERE food_id ==" + id + ";", null);
          Log.i("successfully:", Integer.toString(cursor.getCount()));
          return 1;*/
  
      myDbHelper.openDataBase();
          ContentValues values=new ContentValues();
          values.put("fav","1");
          myDbHelper.openDataBase();
          SQLiteDatabase sqLiteDatabase1=myDbHelper.getMyDataBase();
         int part= sqLiteDatabase1.update("food",values,"food_id="+id,null);
          myDbHelper.close();
          Log.i("update","successful"+part);
          return  part;
  
      }
  
  }
  </code></pre>
  
  <p>and here is my TwoFragment class code:</p>
  
  <p>package com.example.android.dezcook;</p>
  
  <pre><code>import android.content.Context;
  import android.net.Uri;
  import android.os.Bundle;
  import android.support.annotation.Nullable;
  import android.support.v4.app.Fragment;
  import android.util.Log;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ArrayAdapter;
  import android.widget.ListAdapter;
  import android.widget.ListView;
  import android.widget.TextView;
  
  import com.example.android.dezcook.R;
  
  import java.lang.reflect.Array;
  import java.util.ArrayList;
  import java.util.List;
  
  
  public class TwoFragment extends Fragment {
      public TwoFragment()
      {
      }
  
      @Override
      public void onCreate(@Nullable Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          // Inflate the layout for this fragment
          View v = inflater.inflate(R.layout.fragment_two, container, false);
  
          Foot_recipe foot_recipe=(Foot_recipe)getActivity();
  
          Food food=foot_recipe.sendFrag_info();
  
        /*  ListView listView=(ListView)v.findViewById(R.id.show_items);
          listView.setAdapter();
  */      String[] arr=food.getItems().split("،");
  
          Log.i("LogArr",arr[0]);
        //  ArrayAdapter adapter = new ArrayAdapter&lt;String&gt;(getActivity(),R.layout.list_items_frag, arr);
          ListView listView = (ListView) v.findViewById(R.id.show_items);
          listView.setAdapter(new details_list_adapter(getActivity(),arr));
          return v;
      }
  
  }
  </code></pre>
  
  <p>and TwoFragment xml code: </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"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      tools:context="com.example.android.dezcook.TwoFragment"
      android:background="@drawable/gradient_background"
      &gt;
  
      &lt;!-- TODO: Update blank fragment layout --&gt;
  
      &lt;ListView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:id="@+id/show_items"
  
          android:divider="@color/colorPrimaryDark"
  
          /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>and finally the activity that called foot_recipe xml code:</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"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;android.support.design.widget.AppBarLayout
          android:background="@drawable/xml_header_background"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"&gt;
  
  
          &lt;android.support.v7.widget.Toolbar
              android:id="@+id/foodrestoolbar"
              android:layout_width="match_parent"
              android:layout_height="?attr/actionBarSize"
              android:background="@drawable/xml_header_background"
              app:layout_scrollFlags="scroll|enterAlways"
              android:layout_gravity="right"
              app:title=" "
  
              android:gravity="right"
  
              &gt;
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="foot specail"
                  android:layout_gravity="right"
                  android:textSize="25dp"
                  android:textStyle="bold"
                  android:layout_marginRight="10dp"
                  android:textColor="#ffffff"
                  android:id="@+id/toolbar_title" /&gt;
  
          &lt;/android.support.v7.widget.Toolbar&gt;
  
          &lt;android.support.design.widget.TabLayout
              android:id="@+id/tabs"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              app:tabMode="fixed"
              app:tabIndicatorColor="@color/cardview_dark_background"
              app:tabSelectedTextColor="@color/cardview_dark_background"
              app:tabGravity="fill"/&gt;
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
      &lt;android.support.v4.view.ViewPager
          android:id="@+id/viewpager"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          app:layout_behavior="@string/appbar_scrolling_view_behavior"  /&gt;
  
      &lt;android.support.design.widget.FloatingActionButton
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:src="@drawable/floating_btn_heart"
          android:layout_gravity="bottom|right"
          android:background="@color/colorPrimary"
          android:layout_margin="20dp"
          android:id="@+id/fav_btn_heart"
          /&gt;
  &lt;/android.support.design.widget.CoordinatorLayout&gt; 
  </code></pre>