Code example for ListFragment

Methods: getActivity, onListItemClick, startActivity

3
	 * @see android.support.v4.app.ListFragment#onListItemClick(android.widget.ListView, android.view.View, int, long) 
	 */ 
	@Override 
	public void onListItemClick(ListView l, View v, int position, long id) {
		// TODO Auto-generated method stub 
		super.onListItemClick(l, v, position, id);
		/* 
		Fragment newContent = null; 
		switch (position) 
		{ 
		case 0: 
			newContent = new StubContentFragment(); 
			break; 
		case 1: 
			newContent = new MainContentFragment(); 
			break; 
		} 
		if (newContent != null){ 
			switchFragment(newContent); 
		} 
		*/ 
		Intent i = new Intent();
		switch (position){
		case 0: 
			i.setClass(getActivity(), AccountActivity.class);
			break; 
		case 1: 
			i.setClass(getActivity(), AccountActivity.class);
			break; 
		} 
		if (i != null){
			startActivity(i);			
		} 
	} 
 
	private void switchFragment(Fragment newContent) {
		if (getActivity() == null)