irobotxx
irobotxx

Reputation: 6063

getting text dynamically from EditableText android

i am trying to get the text input/values from an EditText widget as its being typed. please anybody know how or which method i should use? can't seem to find one that will help. thanks for your consideration.

i tried this but not working:

  Entry = (EditText)findViewById(R.id.typeEntryId);
          viewEntry = (TextView)findViewById(R.id.viewEntryId);

       if(Entry != null){
            //viewEntry.setText(Entry.getEditableText().toString());
                  viewEntry.setText(Entry.getText().toString());
        }

Upvotes: 0

Views: 177

Answers (2)

Cheryl Simon
Cheryl Simon

Reputation: 46844

Use a TextWatcher.

Upvotes: 2

Ryan Conrad
Ryan Conrad

Reputation: 6900

EditText field = (EditText) findViewById(R.id.myField);
if ( field != null ) {
  Log.d ("myField",field.getText().toString());
}

you should be able to just do that. The getText() method returns an Editable type which implements CharSequence

Upvotes: 0

Related Questions