A Loader is designed to be used from within a Fragment or an Activity since it is intended to be used to update some UI component when it finishes it's loading process.
If you need a custom implentation of the Loader, you can extend AsyncTaskLoader ( http://developer.android.com/reference/android/content/AsyncTaskLoader.html ) and use it to process your results. Another option to initialize the LoaderManager for an activity from another class is to pass the instance of that Activity to the other class and the use this instance.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.