Update the progress bar of each book in the bookcase form (listview nested Gallery:
1. Complete Compilation of multi‑thread and resumable download drivers;
2. Use the service to start the download task and inherit from the service. If intentservice is inherited, The onhandleintent method can only process one intent at a time, and the next intent is processed sequentially after the intent ends;
3. Broadcast update Interface
Because listview is nested with gallery, the current task status is determined in Gallery. setonclickitemlistener of listadapter. The current task status is not downloaded, downloaded, or paused, and different responses are made. Then add the broadcast receiver to the galleryadapter to update the current Gallery.
Because it is a multi-task download, it means to declare a global variable, used to record "rows, columns, progress", type isMap <string, Map <integer, integer>. When starting a task, pass the value of the row and column into the service through intent, then pass in the downloader in the service, and finally expose it in the listener of the downloader, transmits rows, columns, and progress together to the receiver through broadcast. The progress bar is displayed for judging global variables in getview of galleryadapter.
Other questions: how do I pause a download task for a download loader ?? The main problem is how to obtain the objects of the Custom Service class.
Effect