public void restoreInputState() { skipOnTextChanges = true; inputView.setText(ChatManager.getInstance().getTypedMessage(account, user)); inputView.setSelection( ChatManager.getInstance().getSelectionStart(account, user), ChatManager.getInstance().getSelectionEnd(account, user)); skipOnTextChanges = false; if (!inputView.getText().toString().isEmpty()) { inputView.requestFocus(); } }
public void saveInputState() { ChatManager.getInstance() .setTyped( account, user, inputView.getText().toString(), inputView.getSelectionStart(), inputView.getSelectionEnd()); }