Code example for SparseArray

Methods: put

0
import fr.oni.cookbook.fragment.edit.EditStepsFragment; 
import fr.oni.cookbook.fragment.edit.EditTitleFragment; 
 
public class RecipeEditPagerAdapter extends FragmentStatePagerAdapter { 
 
	SparseArray<Fragment> fragArray = new SparseArray<Fragment>();
 
	public RecipeEditPagerAdapter(FragmentManager fm) {
		super(fm);
		fragArray.put(0, createFragment(EditTitleFragment.class));
		fragArray.put(1, createFragment(EditIngredientsFragment.class));
		fragArray.put(2, createFragment(EditStepsFragment.class));
	} 
 
	@Override 
	public Fragment getItem(int i) {
		return fragArray.get(i);
	} 
 
	@Override 
	public int getCount() {