Code example for Fragment

Methods: onCreate

0
	private ListView activityList;
	ActivitiesAdapter adapter;
	 
	@Override 
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	} 
	 
	@Override 
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		final View v = inflater.inflate(R.layout.fragment_profileactivity, null);
		activityList = (ListView) v.findViewById(R.id.profile_details_activitylist);
		if (adapter != null) {
			displayActivities(); 
		} 
		return v;
	} 
	 
	public void setActivitiesAndUser(Context context, final ActivitiesResponse[] activities, UserDetails user ) {
		// Set the activities, create the adapter 
		adapter = new ActivitiesAdapter(context, activities, user);