Is it possible to simulate a "click" (touch screen) by coordinates or on a view element?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
presumably you have something that you wish to invoke via a click. So... if it's an actual button you can call
performClick()
on it. If it's not a button, then just call whatever the method you wish to execute is, when the conditions that you expect are met. It might help if you offered a little more details as to what you're actually trying to do.It is possible to simulate touch events on android screen. If you have the coordinates of the view then you can generate touch events by using adb shell commands. For e.g-
adb shell input tap x y
where x and y are your coordinates. You can run this command from terminal. If you want to run the command from android code then use "/system/bin/ input tap x y" and run this by using Runtime.getRuntime() method. For details please reply, happy to help! :)
As azdev suggests, try this:
On a View, yes. By coordinates, a la Java Robot, not that I'm aware.
For example: