@Override public void onDestroy(){
synchronized (mThread) {
    mReady=false;
    mQuiting=true;
    mThread.notify();
  }
  super.onDestroy();
}

@ Override public void onDestroy ( ) { synchronized ( mThread ) { mReady = false ; mQuiting = true ; mThread . notify ( ) ; } super . onDestroy ( ) ; }
this is called when the fragment is going away . it is not called when the fragment is being propagated between activity instances .
