user345602
user345602

Reputation: 598

Android OnKeyListener

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.

Upvotes: 1

Views: 3501

Answers (1)

jax
jax

Reputation: 38573

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;

Upvotes: 4

Related Questions