[英]How to check webservice is finish perform?
I have a webservice that download about 100 lines data and store into local database. 我有一个Web服务,可以下载约100行数据并将其存储到本地数据库中。
Then, from database sqlite
, it will allocate into difference list. 然后,从数据库
sqlite
,它将分配到差异列表中。
I want to get the response from web service when the data is downloading from server to database, either is in progress or finished and should return the status. 当数据正在从服务器下载到数据库时,我想从Web服务获取响应,无论是正在进行还是完成,都应该返回状态。
I need the status to do some action. 我需要状态才能采取措施。
Use AsyncTask
for downloading information from web-services to application that will take care about the response (ie progress ) here the document : AsyncTask 使用
AsyncTask
将信息从Web服务下载到应用程序,该文件将关注文档的响应(即进度): AsyncTask
tutorial : AsyncTask - Tutorial 教程: AsyncTask-教程
Design it in such a way that an Intent will be broadcast upon completion. 设计方式应使Intent在完成时被广播。 This is the cleanest way to do it, and broadcast it exclusively to your app.
这是最干净的方法,并将其专门广播到您的应用程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.