Android
replacing the AsyncTask with an AsyncTaskLoader.
github: Done S05.01: with AsyncTaskLoader
- Have MainActivity implement the loader callbacks
- Create a loader ID
- Fill out the loader callbacks using the code from FetchWeatherQuery
- Call initLoader in onCreate (whether or not the loader already exists)
- Restart the loader if refresh is triggered from the menu
Memory Monitor Workflow
To profile and optimize memory use, the typical workflow is to run your app and do the following:
- Profile the app using the Memory Monitor to find out whether undesirable garbage collection event patterns might be causing performance problems.
- If you see many garbage collection events in a short amount of time, dump the Java heap to identify candidate object types that get or stay allocated unexpectedly or unnecessarily.
- Start allocation tracking to determine where any problems are happening in your code.
