János János - 1 year ago 101
Android Question

startActivity should performed on main thread?

Need to do a transition from one activity to an other. Need

executed on main thread on it can be a worker thread? I would choose main thread concept, because there are GUI related operations. What do you think?

Answer Source

Yes, it should. Basically, "where", in the sense of Context, your new Activity should be placed in its stack or under/above others.

From documentation:

Launch a new activity. You will not receive any information about when the activity exits.

Note that if this method is being called from outside of an Activity Context, then the Intent must include the FLAG_ACTIVITY_NEW_TASK launch flag. This is because, without being started from an existing Activity, there is no existing task in which to place the new activity and thus it needs to be placed in its own separate task.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download