MediaPlayer inside ViewPager Fragment
Asked Answered
A

0

0

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. scroll issue

How can I prevent this?

Adaliah answered 29/11, 2014 at 8:52 Comment(2)
Implement view holder pattern for your listviewDigit
I recommend using the example of the viewScleroderma

© 2022 - 2024 — McMap. All rights reserved.