The getText() method of EditText return a object of Editable, not String. In order to retrieve the text of EditText, toString() of Editable can be used.
EditText myEditText = (EditText)findViewById(R.id.myedittext);
...
String stringEditText = myEditText.getText().toString();
2 comments:
EditText input = (EditText) findViewById(R.id.editText);
The app crashes with this code.
You forgot the layout from where the Text should read.
try this:
EditText input = (EditText) layout.findViewById(R.id.editText);
Post a Comment