Android 中的仪表
在检测类中,android api 说
“这个类将在任何应用程序代码之前为您实例化,允许您监视系统与应用程序的所有交互。”
http://developer.android.com/reference/android/view/View .OnGenericMotionListener.html
这是否意味着我可以捕获由于用户交互而生成的所有 UI 事件。例如,我可以捕获用户与 UI 交互时生成的动作和按键事件吗?如果这是可能的,请告诉我如何做。谢谢
In the instrumentation class the android api says
"this class will be instantiated for you before any of the application code, allowing you to monitor all of the interaction the system has with the application."
http://developer.android.com/reference/android/view/View.OnGenericMotionListener.html
Does this mean i can capture all UI generated events as a result of a user's interaction. For example can i capture the motion and keyevents that are generated when a user interacts with the UI. If this is possible please tell me how. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过各种侦听器捕获事件。例如,如果您想捕获触摸和手势,您可以使用手势侦听器。同样,还有按键事件、按钮单击等的侦听器。有一些事件(点击“主页”按钮)您无法捕获或看到,但大多数事件都可以侦听。
You can capture events via various listeners. For example if you want to capture touches and gestures you can use a gesture listener. Likewise there are listeners for key events, button clicks, etc. There are a few events (hitting the 'home' button) that you can not catch or see, but otherwise most can be listened for.