Code example for ListFragment

Methods: setArguments

0
 
/** 
 * @author Bai Jie 
 * 
 */ 
public class ListCoursesFragment extends ListFragment {
	public static final String COURSES_KEY = "org.orange.querysystem.simplecourses.key";
 
	private boolean hasRemovedRepeated = false;
 
	public static ListCoursesFragment newInstance(ArrayList<SimpleCourse> courses){
		ListCoursesFragment listADay = new ListCoursesFragment();
		Bundle args = new Bundle();
		args.putParcelableArrayList(COURSES_KEY, courses);
		listADay.setArguments(args);
		return listADay;
	} 
 
	@Override 
	public void setArguments(Bundle args) {
		super.setArguments(args);
		hasRemovedRepeated = false;
	} 
 
	/** 
	 * 应用{@link #setArguments(Bundle args)}设置的Courses,{@link #onCreate(Bundle)}会自动调用此方法<br />