title: getting empty arraylist to fragment activity
body: <p>I am sending arraylist from gridviewadapter to the fragment but data its not displayed. the gridview code was working when sending arraylist to an activity, so the problem is with the fragment</p>
  
  <p>this is the grid view adapter</p>
  
  <pre><code>@Override
  public View getView(int position, View convertView, ViewGroup parent) {
      System.out.println("entering adapter1");
  
      View row = convertView;
    final  ViewHolder holder;
  
  
      if (row == null) {
          LayoutInflater inflater = LayoutInflater.from(mcontext);
          row = inflater.inflate(layoutResourceId, parent, false);
          holder = new ViewHolder();
          holder.imageTitle = (TextView) row.findViewById(R.id.text);
          holder.imageView = (ImageView) row.findViewById(R.id.imageView);
          row.setTag(holder);
      } else {
          holder = (ViewHolder) row.getTag();
      }
      final Listitem item = getItem(position);
      System.out.println("item.getUrl() ");
      System.out.println(item.getUrl());
      Picasso.with(mcontext).setIndicatorsEnabled(true);
      holder.imageTitle.setText(item.getId());
  
     /* Picasso.
              with(mcontext).
              load(item.getUrl())
              .placeholder(R.drawable.logo)
              .fit()
              .noFade()
              .into(holder.imageView)
              ;*/
      //int maxSize = 4 * 1024 * 1024; // 4MiB
  
      //Picasso myNewPicasso = new Picasso.Builder(mcontext).memoryCache(new LruCache(maxSize)).build();
  
      Picasso.with(mcontext)
              .load(item.getUrl())
              .placeholder(R.drawable.logo)
              .fit()
              .noFade()
              .into(holder.imageView);
      holder.imageView.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              // TODO Auto-generated method stub
  
              ArrayList&lt;Listitem&gt; personArrayList = new ArrayList&lt;&gt;();
              personArrayList.add(new Listitem(item.getId(), item.getUrl()));
  
              Intent intent = new Intent(mcontext,SingleViewActivity.class);
              intent.putExtra("Person_List", personArrayList);
              intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
              mcontext.startActivity(intent);
  
              Log.d("OnImageButton", "Clicked");
          }
      });
  
  
      return row;
  }
  
  static class ViewHolder {
      TextView imageTitle;
      ImageView imageView;
  }
  </code></pre>
  
  <p>this is the fragment that contain also a view pager</p>
  
  <pre><code>public class SingleViewActivity extends FragmentActivity {
      ImageView   imageView;
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_page_view);
          DemoCollectionPagerAdapter      mDemoCollectionPagerAdapter =      new DemoCollectionPagerAdapter( getSupportFragmentManager());
          ViewPager    mViewPager = (ViewPager) findViewById(R.id.pager);
             imageView = (ImageView) findViewById(R.id.funnyimage);
          Bundle bundle = getIntent().getExtras();
          Log.d("s","singleview");
          mViewPager.setAdapter(mDemoCollectionPagerAdapter);
      }
  
      /*  if (savedInstanceState == null) {
              // During initial setup, plug in the details fragment.
              MyFragment myrag = new MyFragment();
              myrag.setArguments(getIntent().getExtras());
              getSupportFragmentManager().beginTransaction().add(android.R.id.content, myrag).commit();
          }
  */
          // Since this is an object collection, use a FragmentStatePagerAdapter,
          // and NOT a FragmentPagerAdapter.
  
          public class DemoCollectionPagerAdapter extends FragmentStatePagerAdapter {
              public DemoCollectionPagerAdapter(FragmentManager fm) {
                  super(fm);
                  Log.d("s","adapterview");
              }
  
              @Override
              public Fragment getItem(int i) {
                  Fragment fragment = new DemoObjectFragment();
                  Bundle args = new Bundle();
                  // Our object is just an integer :-P
                  args.putInt(DemoObjectFragment.ARG_OBJECT, i + 1);
                  fragment.setArguments(args);
                  return fragment;
              }
  
              @Override
              public int getCount() {
                  return 100;
              }
  
              @Override
              public CharSequence getPageTitle(int position) {
                  return "OBJECT " + (position + 1);
              }
          }
  
  // Instances of this class are fragments representing a single
  // object in our collection.
          public static class DemoObjectFragment extends Fragment {
              public static final String ARG_OBJECT = "object";
      ImageView   imageView;
      int imageResourceId;
      int numberSelected;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          //change to avoid orientation crash
          Log.d("s","fragview");
  
      }
      public static Fragment newInstance(Context context,ArrayList&lt;Listitem&gt; personArrayList, int numberSelected) {
          DemoObjectFragment f = new DemoObjectFragment();
          Bundle args= new Bundle();
  
          args.putParcelableArrayList("Person_List", personArrayList);
          //args.putInt("",imageResourceId);
          f.setArguments(args);
          return f;
      }
              @Override
              public View onCreateView(LayoutInflater inflater,
                                       ViewGroup container, Bundle savedInstanceState) {
                  // The last two arguments ensure LayoutParams are inflated
                  // properly.
  
                  View rootView = inflater.inflate(
                          R.layout.fragment_collection_object, container, false);
                //  Bundle args = getArguments();
               //   ((TextView) rootView.findViewById(R.id.text1)).setText(Integer.toString(args.getInt(ARG_OBJECT)));
                  Bundle args= new Bundle();
  
  
  
                  ArrayList&lt;Listitem&gt; personArrayList = args.getParcelableArrayList("Person_List");
                  System.out.print(personArrayList);
  
                  System.out.print("here1");
  
                  if (personArrayList != null &amp;&amp; !personArrayList.isEmpty()) {
                      for (Listitem person : personArrayList) {
                          Picasso.
                                  with(getActivity()).
                                  load(person.url)
                                  .placeholder(R.drawable.logo)
                                  .fit()
                                  .noFade()
                                  .into(imageView);
                          Log.i("PersonsActivity",String.valueOf(person.url));
                      }
                  }
                  return rootView;
              }
          }
      }
  </code></pre>
  
  <p>A bit explanation of what I am doing <br/>
  In my main activity I have a grid view of image, when I click on one image , I get the single image-clicked on a new activity. I used that with parcelable arraylist  that send data from gridview to singleview acitivity. it was working for the activity. but when I implemented the viewpager and the fragment and fragment adapter nothing is showing I dont know why,</p>
  
  <p>this is my logcat , as you notice its not proceeding to the rest,fragview is a <code>log print</code> added in my code.</p>
  
  <pre><code>01-11 20:54:40.814 3323-3323/com.justedhak.www.i D/Activity: performCreate Call secproduct feature valuefalse
  01-11 20:54:40.814 3323-3323/com.justedhak.www.i D/Activity: performCreate Call debug elastic valuetrue
  01-11 20:54:40.829 3323-3323/com.justedhak.www.i D/s: fragview
  01-11 20:54:40.839 3323-3323/com.justedhak.www.i D/s: fragview
  01-11 20:54:40.954 3323-3323/? I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@211f949f time:9248062
  </code></pre>
  
  <p>this is part of the fragment code in Singleviewactivity.java</p>
  
  <pre><code>        public static class DemoObjectFragment extends Fragment {
          public static final String ARG_OBJECT = "object";
  ImageView   imageView;
  int imageResourceId;
  int numberSelected;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      //change to avoid orientation crash
      Log.d("s","fragview");
  
  }
  public static Fragment newInstance(Context context,ArrayList&lt;Listitem&gt; personArrayList, int numberSelected) {
      DemoObjectFragment f = new DemoObjectFragment();
      Bundle args= new Bundle();
  
      args.putParcelableArrayList("Person_List", personArrayList);
      //args.putInt("",imageResourceId);
      f.setArguments(args);
      return f;
  }
          @Override
          public View onCreateView(LayoutInflater inflater,
                                   ViewGroup container, Bundle savedInstanceState) {
              // The last two arguments ensure LayoutParams are inflated
              // properly.
  
              View rootView = inflater.inflate(
                      R.layout.fragment_collection_object, container, false);
            //  Bundle args = getArguments();
           //   ((TextView) rootView.findViewById(R.id.text1)).setText(Integer.toString(args.getInt(ARG_OBJECT)));
              Bundle args= new Bundle();
  
  
  
              ArrayList&lt;Listitem&gt; personArrayList = args.getParcelableArrayList("Person_List");
              System.out.print(personArrayList);
  
              System.out.print("here1");
  
              if (personArrayList != null &amp;&amp; !personArrayList.isEmpty()) {
                  for (Listitem person : personArrayList) {
                      Picasso.
                              with(getActivity()).
                              load(person.url)
                              .placeholder(R.drawable.logo)
                              .fit()
                              .noFade()
                              .into(imageView);
                      Log.i("PersonsActivity",String.valueOf(person.url));
                  }
              }
              return rootView;
          }
      }
  }
  </code></pre>