I have an Android app which launches an asynctask to synchronyze files with a remote FTP. The syncing process is done on background so that we can still open and read files. For a reason that I don't understand after a few hours of testing my app keeps crashing randomly with the messages following :
04-21 14:26:47.926 SM-T585 : Warning 5355 ActivityManager Force removing ActivityRecord{easyDoc/md516a8905f8e96d5.MainActivity t1431}: app died, no saved state
04-21 14:26:47.926 SM-T585 : Info 5355 WindowState WIN DEATH: Window{47e1c65 u0 d0 easyDoc/md516a8905f8e96d5.MainActivity}
04-21 14:26:47.926 SM-T585 : Debug 5355 ActivityManager removeProcessNameLocked mProcessNames.remove pid=20496 ,hash=156239617 ,name=easyDoc
04-21 14:26:47.926 SM-T585 : Info 5355 ActivityManager Process easyDoc.easyDoc (pid 20496)(adj 0) has died(105,633)
04-21 14:26:47.926 SM-T585 : Debug 5355 ActivityManager isAutoRunBlockedApp:: easyDoc.easyDoc, Auto Run ON
What can I do to debug this and prevent my app to be killed by the activity manager ?
AsyncTask
since they are not recommended to be used for long tasks. Try a stickyService
instead as @mVck has suggested. – Abbas