Home > Mobile >  SingleTask type of activity is how to distinguish the new call or bright screen resume?
SingleTask type of activity is how to distinguish the new call or bright screen resume?

Time:11-02

A standard activity, opening a new thread in onCreate perform the function of downloading data and display the download progress bar,
But sometimes because of various reasons card master, can't download success, and there is no return to download failure, lead to the activity is not destroyed,
Call again when out of the car to perform download the original activity of onStart function, so not to download, supposedly standard activity, startActivity ought not to back up a new activity? Why call or old activity?

That if the activity is now set to singleTask mode, every call is the same activity, performed in the onStart download operation, how to distinguish the new call out the bright screen after screen to perform?
In addition, the server does not support multi-threaded download data,

Can call when the activity every time in the intent to set up a different parameter values for the new call, take out the intent in the activity of the onStart parameter value compared with the old value, change is the new call,

That in addition to this, everyone is how to distinguish? Because users out the screen again bright screen can re-execute onStart function, so we need to distinguish whether new calls,

CodePudding user response:

In writing to download Service

CodePudding user response:

The
reference 1/f, lam lam's reply:
written in Service download

Thank you very much! Do need business from the UI,

CodePudding user response:

Add the activity to the list, each start to add, destroyed a delete,, every time judgment when you download the queue to have this activity, so start again destroyed
  • Related