Reputation: 21
I have written code for setOnKeyListener to EditText widget in Android. But im gonna confusing why got error. The below is my code
I have followed tutorial from book. But it still error. Can you give me a solution?
Upvotes: 0
Views: 309
Reputation: 10358
You are importing android.content.DialogInterface.OnKeyListener
. What you want to import is android.view.View.OnKeyListener
.
When you import android.content.DialogInterface.OnKeyListener
Eclipse is trying to find a setOnKeyListener
method in EditText
that takes android.content.DialogInterface.OnKeyListener
as a parameter, but such a method does not exist.
Upvotes: 4