My application has 3 activities-Main menu, sub menu, detail. Every time the APPLICATION resumes, I want to get some intimation so that I can start downloading some files.
Right now what i am doing is- on each activity onResume
, i check if downloading is already going on or not. If it isn't then i start downloading. This way, whenever i start next/previous activity, if the downloading is not going on, it starts downloading. Meaning, once downloading was completed, user navigates to next page, downloading started again.
I want to prevent this behaviour otherwise there will be unnecessary internet usage.
If i maintain a global (application level) variable which keeps a track of download state, even after i resume the application, the value is not re-set.
Any suggestion as to how to get the onResume
of application.