Android’s ProgressBar instantly displays download progress details
Here, the progress bar is used to display the download progress in real time.
Problems encountered on the way:
1. URL cannot be opened in the main thread, and toast can only be used in the main thread
2. A child thread cannot modify the UI
3. Allow network protocols
4. Pause download and resume download
fragment_ Main layout file
strings. xml
(question 3) configure <-- Request network permission -- > < uses permission Android: name = "Android. Permission. Internet" / >
Mainactivity (question 1, 2)
**************However, it does not solve problem 4. It needs to continue transmission with breakpoints, but it will not store assets resources***************
The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.