Android design pattern for background operation with UI and non-UI modes
问题 I have a background operation that I'd like to be able to run in two modes: UI mode , which is launched by the user and provides the user precise feedback on the state of the operation throughout its life cycle. non-UI mode , which is launched by AlarmManager and provides the user with a summary of the operation at the end of its life cycle. The natural design choice to achieve only UI mode would be AsyncTask and the natural design choice to achieve only non-UI mode would be IntentService .