title: Use fragments with fancy coverflow adapter
body: <p>I am trying to implement a cover flow layout using <a href="https://github.com/davidschreiber/FancyCoverFlow" rel="nofollow">fancy-coverflow</a>. Instead of image I am trying to load fragments. Fancy coverflow supports the use of viewgroup instead of an image. This is the code I am trying to use</p>
  
  <pre><code>public View getCoverFlowItem(int i, View reuseableView, ViewGroup viewGroup) {
              LinearLayout linearLayout = null;
  
              if (reuseableView != null) {
                  linearLayout = (LinearLayout) reuseableView;
              } else
              {
  
  
                  linearLayout = new LinearLayout(context);
                  linearLayout.setLayoutParams(new FancyCoverFlow.LayoutParams(750, ViewGroup.LayoutParams.WRAP_CONTENT));
              }
              FrameLayout frame = new FrameLayout(viewGroup.getContext());
              frame.setId(i+10000);
              linearLayout.addView(frame);
              FragmentManager fragmentManager = getFragmentManager();
              FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
              fragmentTransaction.add(i+10000,ItemFragment.init(i));
              fragmentTransaction.commit();
  
  
  
  
  
              return linearLayout;
          }
  </code></pre>
  
  <p>But this is not working, even if there is only one item to show the getView method is called infinite number of times. But if I remove the fragment transaction commit it will work only once.</p>
  
  <p>Whats going wrong here?</p>