public class PageFragment extends Fragment {
public static final String ARG_PAGE = "ARG_PAGE";
private int mPage;
public static PageFragment newInstance(int page) {
Bundle args = new Bundle();
args.putInt(ARG_PAGE, page);
PageFragment fragment = new PageFragment();
fragment.setArguments(args);
return fragment;
}
I am confuse about the code above where the fragment has something called setArguments(args)
.
I am not exactly sure what exactly does this `setArguments(args) and I also want to know what does the getArgument() method do since I saw it while looking at the developer.android.com.