Use Pageradapter to implement Viewpager page swipe functionality:
1. Layout, Viewpager display by default will occupy the entire display, you need to specify the size
2. Its operation is as follows: first get the number of pages that need to be displayed through GetCount (), but not all the pages are loaded at once, instead of the default 3 pages, save the previous page and preload the next page, so each page that is not needed for 3 pages is called Destroyitem (Container,position,obj) method is destroyed, pre-loading invokes Instantiateitem (container,position) instantiation of the page Note that the object object returned by Instantiateitem is Destroyitem's object parameter, providing a convenient opportunity to delete the page, so only through Container.removeview ((View) obj) method to delete the corresponding page
Android Learning Note (vi) Viewpager