Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 ImageView。当用户点击它时,我想要,android 键盘出现,用户选择一个键,我抓住选择的键,键盘消失。我知道如何显示/隐藏键盘,但我想知道如何检测用户选择的键。请不要告诉我创建自己的键盘。提前谢谢。
覆盖 onKeyDown():
@Override public boolean onKeyDown(int keyCode, KeyEvent event) { super.onKeyDown(keyCode, event); //keyCode is the key that was pressed }