@Override public void onResume() { super.onResume(); eventBus.register(this); Optional<Chat> chat = userProfile.getChat(chatId); if (chat.isPresent() && !chat.get().messages.isEmpty()) { setData(chat.get()); } }
@Override public void onPause() { super.onPause(); eventBus.unregister(this); }