You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have used the code of RecyclingPagerAdapter from android-demo/src/com/jakewharton/salvage/RecyclingPagerAdapter.java and RecyleBin from android-demo/src/com/jakewharton/salvage/RecycleBin.java but when I try to see the last page from first page before all the pages have been cycled through the app crashes.
The text was updated successfully, but these errors were encountered:
Hi varunrramani This may be too late answer for you but may help others who have the same issue and have not resolved. i have also faced same issue, but solution is easy. open the file RcyclingPagerAdapter.java and go to method "instantiateItem(ViewGroup container, int position) " and add below line of code before "container.addView(view);"
if(view.getParent()!=null)
((ViewGroup)view.getParent()).removeView(view);
This will resolve the issue, Since when we try to see the last page from current page before all the pages have been cycled container already has the same view so it crashes saying remove the view or view already exist. so in the above code first if statement checks the view is present in parent or not if vie is there it removes the view ("((ViewGroup)view.getParent()).removeView(view);") from the parent and then adds it again. Hope this helps.
I have used the code of RecyclingPagerAdapter from android-demo/src/com/jakewharton/salvage/RecyclingPagerAdapter.java and RecyleBin from android-demo/src/com/jakewharton/salvage/RecycleBin.java but when I try to see the last page from first page before all the pages have been cycled through the app crashes.
The text was updated successfully, but these errors were encountered: