android - Should Asynctask be paused when the user clicks home button -
had situation while asyctask running. user clicks home button while asynctask running . should asynctask allowed run when app in background or should paused , resumed when app comes foreground . it depends. asynctask doing? if synchronizing data server, should left alone. async task doing have redone in onresume()? cancel it. if loading data, go either way. activity/fragment force reload of data in onresume() or allow loader (you using async loaders hope) fill in data loaded in background when user temporarily switched background? you have ask yourself, task running expensive (resource-wise) won't helpful when not in foreground? also keep in mind, os cancel task on own too. long you're cleaning resources appropriately, handling cancellations , null activities in callbacks appropriately, leaving running won't end of world.