PageAdapter is an abstract class that inherits directly from object and is imported into the package Android.support.v4.view.PagerAdapter to be used.
To use Pageradapter,
The first step is to inherit the Pageradapter class, overwriting at least the following methods:
The following four methods are called each time a viewpager or swipe is created, and the methods in Instantiateitem and Destroyitem are implemented on their own.
public abstract int GetCount ();
This method is to get the current form interface number
Public abstract Boolean Isviewfromobject (Android.view.View arg0, Java.lang.Object arg1);
This method is used to determine whether the interface is generated by the object
Public int position);
This method, return an object that indicates which object the Pageradapter adapter chooses to place in the current Viewpager
Public void int position, java.lang.Object Object);
This method is to remove the current view from the ViewGroup
Public classViewpageradapterextendspageradapter{@Override Public intGetCount () {//TODO auto-generated Method Stub return0; } @Override Public BooleanIsviewfromobject (View arg0, Object arg1) {//TODO auto-generated Method Stub return false; } @Override Public voidDestroyitem (View container,intposition, Object object) { //TODO auto-generated Method Stub Super. Destroyitem (container, Position, object); } @Override PublicObject Instantiateitem (View container,intposition) { //TODO auto-generated Method Stub return Super. Instantiateitem (container, position); } }