He estado siguiendo los tutoriales oficiales de Android y de alguna manera estoy teniendo un problema con this very simple example para ejecutar una función después de presionar "Enter" para un EditText.Android ejecutar la función después de presionar "Enter" para EditText
entiendo lo que tengo que hacer y parecen tener todo configurado correctamente, pero se queja de Eclipse con esta línea:
edittext.setOnKeyListener(new OnKeyListener() {
subraya setOnKeyListener
con el error:
The method setOnKeyListener(View.OnKeyListener) in the type View is not applicable for the arguments (new DialogInterface.OnKeyListener(){})
Y también subraya OnKeyListener
con el error:
The type new DialogInterface.OnKeyListener(){} must implement the inherited abstract method DialogInterface.OnKeyListener.onKey(DialogInterface, int, KeyEvent)
¿Quizás alguien pueda dispararme en la dirección correcta? Antes de probar otras soluciones (que ya he encontrado en stackoverflow), realmente me gustaría resolver esto porque me tiene nervioso que algo tan simple de seguir, como un tutorial oficial, no parece funcionar.
Gracias de antemano.
Algo como esto? http://stackoverflow.com/questions/4451374/use-enter-key-on-softkeyboard-instead-of-clicking-button/4451825#4451825 – AedonEtLIRA