mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
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:
parent
09638b0c9b
commit
55ff68b729
1 changed files with 11 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue