简体   繁体   English

当应用程序在后台时记录屏幕上的点击频率

[英]Recording frequency of taps on screen while app is in background

Let's say I have an app A and an app B. App A runs and does calculations in the background and I have an app B running on the main thread.假设我有一个应用程序 A 和一个应用程序 B。应用程序 A 在后台运行并进行计算,我有一个应用程序 B 在主线程上运行。 While app B runs on main thread I tap on screen 120 times, is there a way for an app A record screen taps even though it was running in the background?当应用程序 B 在主线程上运行时,我在屏幕上点击了 120 次,有没有办法让应用程序 A 记录屏幕点击,即使它在后台运行?

You can do this via an overlay.你可以通过覆盖来做到这一点。 Create a dummy view something like 1 pixel and place it somewhere out the way in one of the corners.创建一个类似于 1 像素的虚拟视图,并将其放置在一个角落的某个地方。 Then set up a touch event listener ( onTouch ) make sure it returns false though or the actual place you touch wont register the event.然后设置一个触摸事件侦听器( onTouch ),确保它返回 false ,否则您触摸的实际位置不会注册该事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 用户点击屏幕时如何退出无限while循环? - How to exit an infinite while loop when user taps screen? 显示使用Android录制时不断更新的双精度(频率) - Displaying a double (frequency) that is updated constantly while recording with Android 应用程序处于前台状态时锁定屏幕会阻止后台执行(Android) - Locking screen while app is in foreground prevents background execution (Android) 屏幕关闭时Android应用视频录制 - Android app video recording when screen off 屏幕录制应用程序在 Android 10 上不起作用 - Screen recording app does not work on Android 10 停止录制屏幕时应用程序崩溃 - The app crashes when you stop recording screen 使用MediaRecorder在Android上录制时无法获得Surface屏幕 - Failed to get the Surface while Recording screen on Android using MediaRecorder 如何在实现屏幕录制时隐藏按钮或 textView - How to hide a button or textView while implementing screen recording 如何以编程方式检测是否有任何屏幕录制进程/应用程序在 Android 中运行? - How to programmatically detect if any screen recording process/app is running in Android? 如何避免在后台运行时启动应用程序时显示启动画面? - How to avoid showing splash screen when app is launched while running in background?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM