There is an outstanding article on implementing Android loaders. However it covers classic pattern when data is being reloaded each time any part of it is modified. In my case I had to manipulate huge files, some of them taking minutes to load, so I could not afford reloading them on each data set change.
It took me three days to solve the issue of overlapping fragments, lost history and failure to display fragments after device rotation. There are a lot of discussions on these subjects on StackOverflow none of them providing a good working solution. At last I have found a good answer describing the general approach. I've strictly followed the advice and got the working solution which I want now to share with the rest. I have created a Gist containing all necessary code.
This is the common Android UI pattern to use double Back press to confirm exit from application. It has simple implementation. However there is one thing developers do not think about: when user presses Back the toast with confirmation message is continuing to be displayed after application is already quit.
If your application is designed as a background service updating it can be a pain because running application is killed during the update. Fortunately your application can request to receive package update broadcast in AndroidManifest.xml (I have added boot completed broadcast here to show that the logic is pretty much the same):