@Override public void onDetach() { super.onDetach(); if (task != null) { task.unregisterListner(); task.cancel(true); } }
public void refresh(String type) { if (task != null) { task.unregisterListner(); task.cancel(true); } task = new FetchMoviesTask(); task.setOnPostExecuteListner(this); task.execute(type); }