I'm doing a quick log statement in the MainActivity and getting two Enter key presses logged whenever the physical Enter key is pressed on the ASUS Transformer tablet physical keyboard. The key is not being held down.

public boolean dispatchKeyEvent(KeyEvent event) is the method being called when this occurs, twice each time.

Any ideas?

有帮助吗?

解决方案

one is for onKeyDown and one is for OnKeyUp. so it will be having two call for every action. as you mentioned the key is not being held so it will log twice

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top