The lazy load of Android is mainly embodied in such aspects as the asynchronous loading of network data (picture), database query, complex business logic processing and the asynchronous processing caused by time-consuming task operation. In introducing the Android development process, we will briefly review some of the areas that need attention in the Android development process before dealing with this common technical problem asynchronously.
The principles of the single thread model must be followed in Android application development. Because Android UI operations are not thread-safe, the UI-related operations must be done in the UI thread. But not all operations can be carried out in the main thread, Google engineers in the design of the contract, the Android app in 5s without response will lead to ANR (application not Response), which requires developers to follow the two rules: 1, do not block the UI thread , 2. Make sure to access the Android UI Toolkit only in the UI thread. As a result, the technical solution of opening sub-threading for asynchronous processing came into being.
This article takes the custom ListView, asynchronously loads the network picture example, summarizes the Android development process, the common three kinds of asynchronous loading technical solution.
Android Asynchronous Load Solution