Basically, I have one Asynctask for downloading files. I can call this from my main UI activity fine, but what if I want to call it from a different Activity – I.e. one activity is a main menu with a link to download the manual, and another activity is a ListView of all the available documents to be downloaded.
Do I have to create another Asynctask for this?
I am guessing you have AsyncTask in your MainActivity as an innerclass. You can take the code of AsyncTask and put it in a new file which is public(or accessable) to both classes. Remember that you cann’t execute an instance of an AsyncTask more than once, but you can create multiple instances of the AsyncTask.
.
.
All different files.