@Override
 protected void onPause() {
   super.onPause();
   overridePendingTransition(0, 0);
   if (chatActivityEnterView != null) {
     chatActivityEnterView.hideEmojiPopup();
     chatActivityEnterView.setFieldFocused(false);
   }
   ConnectionsManager.getInstance().setAppPaused(true, false);
 }
 @Override
 protected void onResume() {
   super.onResume();
   if (chatActivityEnterView != null) {
     chatActivityEnterView.setFieldFocused(true);
   }
   ConnectionsManager.getInstance().setAppPaused(false, false);
   fixLayout();
   checkAndUpdateAvatar();
   wakeLock.acquire(7000);
 }