Code example for Fragment

Methods: getActivity, onStart

0
	public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
		return inflater.inflate(R.layout.fragment_public_timeline, container, false);
	} 
	@Override 
	public void onStart() { 
		adapter = new PublicTimelineListAdapter(getActivity(), 0);
		initComponents(); 
		super.onStart(); 
	} 
	 
	private void initComponents() { 
		listView = (ListView)getActivity().findViewById(R.id.lvMicroBlog);
		listView.setAdapter(adapter);
		listView.setFastScrollEnabled(true);
         
	} 
}