After updating position 0
We attach adapter consisting of either Fragment objects or simple View objects.
Note: You can download source code of a sample application from here to run the android application. It keeps maximum three views in memory, one which is currently visible, one which is left and one is right of the visible item.
It is called for all the active pages of the adapter(three maximum).
If the data in the fragment present in the collection we simply return its position and if new data not found in the collection we return POSITION_NONE which forces fragments to recreate its view hierarchy again with new data.
While scrolling, the pages which goes out of the screen will be destroyed in destroy Item(View Group, int, Object) method. get Count() returns the number of items which will be shown in the View Pager. is View From Object(View, Object) method checks whether the Object returned from instantiate Item(View Group, int) method is linked to the View supplied here.