简体   繁体   English

Android和Facebook SDK-我的应用程序退出后,RequestAsyncTask仍然可以工作吗?

[英]Android and Facebook SDK - Is RequestAsyncTask still working after my application exits?

Request may take some time to complete (for example when uploading a video). 请求可能需要一些时间才能完成(例如,上传视频时)。

Is it still running after the user exits my application? 用户退出我的应用程序后它仍在运行吗?

It's running on a separate thread, so it should continue to run unless the user kills the application process. 它在单独的线程上运行,因此除非用户终止应用程序进程,否则它应该继续运行。 One way to get around that is to use a Service to run the thread. 解决该问题的一种方法是使用Service运行线程。 That way if the user kills the application process, the thread isn't tied to it. 这样,如果用户终止了应用程序进程,则该线程将不受其约束。 You can show the progress in the notifications. 您可以在通知中显示进度。 This is a pretty standard convention for uploading/downloading files. 这是上传/下载文件的相当标准的约定。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM