@Override public void onDetach(){
synchronized (mThread) {
    mProgressBar=null;
    mReady=false;
    mThread.notify();
  }
  super.onDetach();
}

@ Override public void onDetach ( ) { synchronized ( mThread ) { mProgressBar = null ; mReady = false ; mThread . notify ( ) ; } super . onDetach ( ) ; }
this is called right before the fragment is detached from its current activity instance .
