views:

289

answers:

1

Why I can't implement OnKeyListener with parameter View such as on example where parameters are (View v, int keyCode, KeyEvent event) I'm forced to use parameters (DialogInterface dialog, int keyCode, KeyEvent event) but not the View as I want.

+3  A: 

You need to delete the import statement at the top of your code and change it to the correct one. they probably both have the same same but are in different packages.

Delete

import android.content.DialogInterface.OnKeyListener;

Add

import android.view.View.OnKeyListener;

jax
It works, thank you