问题描述:

When an activity goes into paused state, which can happen when it is partially covered by another activity, what exactly goes into the paused state? More precisely:

  1. Does it pauses Looper from processing incoming tasks or msgs, but it still allows job to be submitted in the Looper msg queue?
  2. If an activity has a messenger, which receives msgs from, suppose a service, is the messenger queue is also paused for processing the task, and but it can still receive msgs? Almost like above case no. 1.
  3. If case 1 or 2 or (1 and 2) are valid then I don't need to take care of UI task buffer for paused state (as suggested in the post How to handle Handler messages when activity/fragment is paused), because once the Activity resumes it will start processing messaging queue and nothing will be lost. Am I right in this assumption?

I feel this is how it should have been implemented, but not sure if this is the case.

网友答案:

in Simple Words .... An activity is in a paused state when the activity is visible but not in focus. It is in Background.

网友答案:

Generally, an Activity is paused means its UI elements are not frontmost. The UI thread is still working. That means the Looper can still process messages. The messenger you mention can still work.

Although the UI elements may not be visible, you can still change their states in background. For example, change a TextView's text. You can see such changes once the Activity is resumed again.

相关阅读:
Top