Code example for Fragment

Methods: onStop

0
    	messageLog.addListener(adapter);
	} 
	 
	@Override 
	public void onStop() { 
		super.onStop(); 
		messageLog.removeListener(adapter);
	} 
	 
	@Override 
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.fragment_chat, container, false);
		 
		ListView listView = (ListView) view.findViewById(R.id.chatConsole);
		listView.setAdapter(adapter);
		listView.setDivider(null);
		listView.setDividerHeight(0);
		listView.setVerticalFadingEdgeEnabled(true);
		 
Connect your IDE to all the code out there  Get Codota for Java