Example #1
0
 @Override
 public void onDetach() {
   super.onDetach();
   if (task != null) {
     task.unregisterListner();
     task.cancel(true);
   }
 }
Example #2
0
  public void refresh(String type) {

    if (task != null) {
      task.unregisterListner();
      task.cancel(true);
    }

    task = new FetchMoviesTask();
    task.setOnPostExecuteListner(this);
    task.execute(type);
  }