Code example for EditText

Methods: getText, getEditableText

0
        return super.onCreateOptionsMenu(menu);
    } 
 
    @InjectOnClickListener(R.id.sendButton) 
    private void onSendButtonClick(View v) {
        String text = messageEditText.getText().toString();
        adapter.add(new Message(new Date(), text));
        messageEditText.getEditableText().clear();
    } 
 
    @InjectOnClickListener(R.id.clearHistoryButton) 
    private void onClearHistoryButtonClick(View v) {
        adapter.clear();
    } 
 
    @InjectOnTextChangedListener(R.id.messageEditText) 
    public void onMessageTextChanged(CharSequence s, int start, int before, int count) {
        String symbolsCountText = String.format(symbolsCountPattern, s.length());
        symbolsCountTextVew.setText(symbolsCountText);
    }