asynchronous - Android background processing, handle result and Activity lifecycle -
i have general problem android background processing, how deal it? imagine scenario: users starts activity fragment. fragments starts fetching data network using intenservice. intentservice provide result fragment via localbroadcast system. broadcastreciever in fragment registered/unregistered in onresume()/onpause(). looks good, when user press home button right after 2) result broadcast intentservice has been lost. happen becouse fragment unregistered broadcastreceiver in onpasue() callback. there general pattern avoid issue? using resultreceiver instead of broadcastreceiver better prupouse? i have tired resultreceiver, in case send resultreceiver service in bundle (it implements parcelable interface) after recreation activity due changing screen orientation resultreceiver has "dirty" reference previusly created activity can cause bugs. your intentservice can create notification on task completion, pending intent activity, in case activity goe