I am using the below code for viewpage inside listview.
ViewPager viewPager = (ViewPager) currentView.findViewById(R.id.pager);
viewPager.setId(position + 1);
viewPager.setPageMargin(30);
ViewPagerAdapter tempMyFriendPagerAdapter = new ViewPagerAdapter(mFragmentManager, mItems.get(position).getViewPagerItems());
viewPager.setAdapter(tempMyFriendPagerAdapter);
Code taken from https://dl.dropboxusercontent.com/u/20178650/builds/listviewwithviewpager.zip
Now say I scroll the listview fast to the bottom, the listview items at top gets destroyed however the first fragment of viewpager is still in memory causing it to show partially on screen.
How can I prevent this?