Code example for Fragment

Methods: onDetach

0
	 
	@Override 
	public void onDetach() { 
		if (thread != null)
			thread.end();
		super.onDetach(); 
	} 
	 
	 
	private class ServiceTableThread extends Thread {
		 
		private boolean running = true;
		 
		@Override 
		public void run() { 
			while(running) {
				Activity a = getActivity();
				if (a == null) {
					running = false;
					break; 
				}