{"action":"created","issue":{"url":"https://api.github.com/repos/gotev/android-upload-service/issues/202","repository_url":"https://api.github.com/repos/gotev/android-upload-service","labels_url":"https://api.github.com/repos/gotev/android-upload-service/issues/202/labels{/name}","comments_url":"https://api.github.com/repos/gotev/android-upload-service/issues/202/comments","events_url":"https://api.github.com/repos/gotev/android-upload-service/issues/202/events","html_url":"https://github.com/gotev/android-upload-service/issues/202","id":183922210,"number":202,"title":"Switch from Delegate to BroadcastReceiver","user":{"login":"chamroeunbm","id":2074857,"avatar_url":"https://avatars.githubusercontent.com/u/2074857?v=3","gravatar_id":"","url":"https://api.github.com/users/chamroeunbm","html_url":"https://github.com/chamroeunbm","followers_url":"https://api.github.com/users/chamroeunbm/followers","following_url":"https://api.github.com/users/chamroeunbm/following{/other_user}","gists_url":"https://api.github.com/users/chamroeunbm/gists{/gist_id}","starred_url":"https://api.github.com/users/chamroeunbm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chamroeunbm/subscriptions","organizations_url":"https://api.github.com/users/chamroeunbm/orgs","repos_url":"https://api.github.com/users/chamroeunbm/repos","events_url":"https://api.github.com/users/chamroeunbm/events{/privacy}","received_events_url":"https://api.github.com/users/chamroeunbm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/gotev/android-upload-service/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-19T10:20:26Z","updated_at":"2016-10-20T02:22:24Z","closed_at":null,"body":"Hi,\r\n\r\nI have a Send button in an activity, which will \r\n- disable while upload in progress\r\n- upload all files to Server (Using parallel upload)\r\n- the button will be invisible when all files are sent\r\n- re-enable if any upload failed.\r\n- delete all uploaded file when receive \"OK\" response from server(NOT using setAutoDeleteFilesAfterSuccessfulUpload)\r\n\r\n**Here comes the problem**\r\n1. if I use Delegate, i can easily detect success, failure, delete success files and update my UI component. BUT if I leave the activity, my activity might get killed and delegate may not be called so i can't delete those uploaded files\r\n2. If I use BroadcastReceiver, I can't update the UI. I saw some people suggest some GET_TASK(ActivityManager), but I think the solution make thing complicated\r\n\r\n\r\nSo what's the best solution?\r\n\r\nThanks;"},"comment":{"url":"https://api.github.com/repos/gotev/android-upload-service/issues/comments/254992222","html_url":"https://github.com/gotev/android-upload-service/issues/202#issuecomment-254992222","issue_url":"https://api.github.com/repos/gotev/android-upload-service/issues/202","id":254992222,"user":{"login":"chamroeunbm","id":2074857,"avatar_url":"https://avatars.githubusercontent.com/u/2074857?v=3","gravatar_id":"","url":"https://api.github.com/users/chamroeunbm","html_url":"https://github.com/chamroeunbm","followers_url":"https://api.github.com/users/chamroeunbm/followers","following_url":"https://api.github.com/users/chamroeunbm/following{/other_user}","gists_url":"https://api.github.com/users/chamroeunbm/gists{/gist_id}","starred_url":"https://api.github.com/users/chamroeunbm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chamroeunbm/subscriptions","organizations_url":"https://api.github.com/users/chamroeunbm/orgs","repos_url":"https://api.github.com/users/chamroeunbm/repos","events_url":"https://api.github.com/users/chamroeunbm/events{/privacy}","received_events_url":"https://api.github.com/users/chamroeunbm/received_events","type":"User","site_admin":false},"created_at":"2016-10-20T02:22:24Z","updated_at":"2016-10-20T02:22:24Z","body":"Thank you very much for spending a lot of time explaining in detail. Much appreciated!"}}
{"actor":{"display_login":"chamroeunbm"}}