¿Cómo recordar el texto escrito en SearchView?

After typing some text in SearchView and closing keyboard the text deletes in SearchView, I want to typed text remain.

preguntado el 28 de agosto de 12 a las 13:08

please explain briefly what you are trying to do? -

@ Ram kiran, I use SearchView, and I want to search text after typing remain in SearchView, not disappear. -

I solve this problem with searchView.setQuery(query,submit) in onCreateOptionsMenu, where query I get from intent. -

(1) En el onQueryTextSubmit() of OnQueryTextListener, you can save it in a field. (2) Then restore the query using searchView.setQuery("query text", false); from the field (by setting a OnClickListener en su SearchView (consulte la sección del este) -

1 Respuestas

use the getText() method and retrieve the text. Or you can use the OnTextChanged event Listener to retrieve the text as it is typed.

Respondido 28 ago 12, 14:08

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.