title: android viewpager inside another viewpager
body: <p>I'm trying to have a viewpager with few views (let's say 5?) and in one of the views (let's say 3rd view?) I have to put another viewpager so after searching for a while, I've come up with some questions which I couldn't get the exact answer for my situtation. </p>
  
  <ul>
  <li>How is it possible to implement a viewpager inside a fragment of another viewpager?</li>
  <li>If it's possible to do the above task, how's the touch function will be handled for viewpagers ? Isn't changing views for the inner viewpager gonna affect the outer one?</li>
  </ul>
  
  <p>I don't really need a code kinda solution but more like a concept kinda solution, so I'm not asking for anyone to do my coding, but I've been quiet away from android and I rather to hear the new concepts from the pros.</p>
  
  <p>thanks in advance.</p>
  
  <p>Edit:</p>
  
  <p>Ok I managed to do it at some point but another problem I'm facing now.
  here is the call to the fragment which contains my viewpager: </p>
  
  <pre><code>Fragment fragment = new Fragment();
  switch(position)
  {
      case 0: fragment = new CalendarFragment();break;
      case 1: fragment = new DummySectionFragment();
              Bundle args = new Bundle();
              args.putInt(DummySectionFragment.ARG_SECTION_NUMBER, 2);
              fragment.setArguments(args);break;
  }
  return fragment;
  </code></pre>
  
  <p>and this is the oncreate of calendarFragment class:</p>
  
  <pre><code>public View onCreateView(LayoutInflater inflater, ViewGroup container,
  Bundle savedInstanceState) {
      View cal = inflater.inflate(R.layout.calendar, container, false);
      viewPager = (ViewPager) cal.findViewById(R.id.calendar_pager);
      viewPager.setOnTouchListener( new OnTouchListener() {
  
          @Override
          public boolean onTouch(View v, MotionEvent event) {
          if(event.getAction() == MotionEvent.ACTION_DOWN &amp;&amp; v instanceof ViewGroup) {
                  ((ViewGroup) v).requestDisallowInterceptTouchEvent(true);
              }
          return false;
      }
      });
      viewPager.setAdapter(createCalendarAdaptor());
      viewPager.setCurrentItem(MONTHS_LIMIT / 2);
      viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
          @Override
          public void onPageSelected(int arg0) {
              //updateResetButtonState();
          }
  
          @Override
          public void onPageScrollStateChanged(int arg0) {
          }
  
          @Override
          public void onPageScrolled(int arg0, float arg1, int arg2) {
          }
      });
      return cal;
  }
  </code></pre>
  
  <p>and I get the calendar in the first fragment and it works just fine and I can easily scroll to next page, and then I can easily move back to the first page, but when I move to 3rd page and then I go back to first page which is my other viewpager it cause an error:</p>
  
  <pre><code>java.lang.IllegalStateException: Recursive entry to executePendingTransactions
  </code></pre>
  
  <p>I'm not quiet sure why is it happening, I've done some searching and it appears it's because I'm using a viewpager inside a fragment... </p>
  
  <p>Any help would be appreciated.</p>