ViewPagerAdapter.java: create new constructor with behavior parameter

Before this commit, ViewPagerAdapter only had one constructor which used the default
behavior where more than the current fragment would be in the Resume state.

This commit adds a constructor where the behavior parameter can be specified.
This commit is contained in:
Jason Whitmore 2025-05-02 16:25:33 -07:00
parent 09638b0c9b
commit 55ff68b729

View file

@ -18,6 +18,17 @@ public class ViewPagerAdapter extends FragmentPagerAdapter {
super(manager);
}
/**
* Constructs a ViewPagerAdapter with a specified Fragment Manager and Fragment resume behavior.
*
* @param manager The FragmentManager
* @param behavior An integer which represents the behavior of non visible fragments. See
* FragmentPagerAdapter.java for options.
*/
public ViewPagerAdapter(FragmentManager manager, int behavior) {
super(manager, behavior);
}
/**
* This method returns the fragment of the viewpager at a particular position
* @param position