Ilham
Ilham

Reputation: 21

Set OnKeyListener function error

I have written code for setOnKeyListener to EditText widget in Android. But im gonna confusing why got error. The below is my code Error in setOnKeyListener

I have followed tutorial from book. But it still error. Can you give me a solution?

Upvotes: 0

Views: 309

Answers (1)

Martin Nordholts
Martin Nordholts

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

Related Questions