使用 CameraCaptureTask 时保持应用程序线程处于活动状态
我有一个正在使用 CameraCaptureTask 的应用程序,但是我的应用程序中运行着一个线程,需要在拍摄照片后使用该线程 - 但是当我的应用程序暂停时,这包括任何线程 - 我可以存储状态或设置,但是我需要保持这个线程运行以将一些数据返回到服务 - 除了在我的应用程序中滚动我自己的相机任务之外,我还能使用什么,这不会像相机任务那样好,相机任务可以工作,但会挂起我的应用程序。
I have an application where I'm using the CameraCaptureTask however I have a thread running in my application that needs to be used after a picture has been taken - however when my application is suspended this includes any threads - I can store state or settings but I need to keep this Thread running to return some data to a service - what can I use other than rolling my own Camera Task in my app which won't be as good as the Camera task which works but suspends my app.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CameraCaptureTask 可能会导致您的应用程序被逻辑删除,这就是阻止您的线程的原因。
解决方案应该是管理所有后台线程的状态,以便它们在逻辑删除后重新启动。我假设您还希望在通过选择器以其他方式进行逻辑删除后重新启动线程,因此滚动您自己的任务版本无论如何都无法完全解决问题。
CameraCaptureTask can cause your app to be tombstoned and this is what's stopping your thread.
The solution should be to manage the state of any background threads such that they are restarted after tombstoning. I assume that you'll also want to restart your thread after tombstoning in ways other via the chooser so rolling your own version of the task wouldn't completely solve the issue anyway.