@Override
 public void onStartTemporaryDetach() {
   super.onStartTemporaryDetach();
   onDetach();
 }
 @Override
 protected void onDetachedFromWindow() {
   super.onDetachedFromWindow();
   onDetach();
 }