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.
每次单击屏幕的任何部分时,我都需要执行一个方法。我试图用 来做到这一点AcessibilityService,但我必须在设置上激活它。我也尝试过使用 a BroadcastReceiver,但它不起作用。有什么想法吗?
AcessibilityService
BroadcastReceiver
只要您想在自己的 Activity 中执行此操作,只需覆盖onTouch().
onTouch()
如果您想在整个设备上执行此操作,则无法通过公共 SDK 进行,您必须在源代码级别自定义 Android。