ui thread - Android UI: when can I directly modify a view? -
i have app 2 activities. main activity start secondary activity using startactivityforresult()
. secondary activity returns data (in form of intent
object) main activity. on main activity have method onactivityresult()
handle come secondary activity.
within onactivityresult()
method, need update view
on main activity (to reflect new data values). not explicitly spawn threads. question is: can directly modify view within onactivityresult()
method, or need put event on ui queue it? more explicit: can sure onactivityresult()
method on ui thread, , in case can forget ui queue?
yes, can modify view in
onactivityresult()
. can modifyactivity
's views anytime after callsetcontentview()
inoncreate()
, long running on ui thread.yes,
onactivityresult()
called on ui thread. true life cycle methods (oncreate()
,onresume()
, etc).
Comments
Post a Comment