简体   繁体   English

Android OnKeyListener

[英]Android OnKeyListener

为什么我不能用参数View实现OnKeyListener, 例如参数是哪个例子 (View v,int keyCode,KeyEvent event)我被迫使用参数( DialogInterface对话框,int keyCode,KeyEvent事件)而不是View as I想。

You need to delete the import statement at the top of your code and change it to the correct one. 您需要删除代码顶部的import语句并将其更改为正确的语句。 they probably both have the same same but are in different packages. 他们可能都有相同的但是在不同的包装中。

Delete 删除

import android.content.DialogInterface.OnKeyListener; import android.content.DialogInterface.OnKeyListener;

Add

import android.view.View.OnKeyListener; import android.view.View.OnKeyListener;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM