Code example for ListFragment

Methods: getActivity, onCreate, setListAdapter

0
		public void onItemSelected(Uri uri);
	} 
	 
	@Override 
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Log.d(TAG, "onCreate()");
		setListAdapter(new ArrayAdapter<String>(this.getActivity(), 
				android.R.layout.simple_list_item_1, items));
	} 
	 
	@Override 
	public void onAttach(Activity activity) {
		super.onAttach(activity);
		try { 
			itemSelectedListener = (OnItemSelectedListener) activity;
		} catch (ClassCastException e) {
			Log.e(TAG, e.getLocalizedMessage());
			throw new ClassCastException(activity.toString() + " must implement OnItemSelectedListener");
		} 
	}