@Override
 protected void onDestroy() {
   InputFragment fragment =
       (InputFragment) getSupportFragmentManager().findFragmentByTag("INPUT_FRAG");
   if (fragment != null && fragment.isVisible()) {
     if (fragment.moga != null) {
       fragment.moga.onDestroy();
     }
   }
   super.onDestroy();
 }
  @Override
  protected void onResume() {
    super.onResume();
    InputFragment fragment =
        (InputFragment) getSupportFragmentManager().findFragmentByTag("INPUT_FRAG");
    if (fragment != null && fragment.isVisible()) {
      if (fragment.moga != null) {
        fragment.moga.onResume();
      }
    }

    CloudFragment cloudfragment =
        (CloudFragment) getSupportFragmentManager().findFragmentByTag("CLOUD_FRAG");
    if (cloudfragment != null && cloudfragment.isVisible()) {
      if (cloudfragment != null) {
        cloudfragment.onResume();
      }
    }
  }