EditText entername = (EditText)findViewById(R.id.enter_name);
// this line convert it to String
String q =entername.getText().toString();
String d = (String) entername.getText();
The method getText() doesn't return a String, but an Editable.
Note that an Editable doesn't extends String, but it implements
CharSequence, so it can be used in many methods that accept