Given the following situation (partially pseudo-code):
- User presses a button in Activity
A
which in turn executes this code:
progressBar.setVisibility(VISIBLE) // by default is set as INVISIBLE in the layout startActivityForResult(ActivityB)
- User rotates his device
Is it possible that step 2 (rotating device) causes a configuration change which leads to the recreation of Activity A
and therefore the progressBar
to be hidden before Activity B
is shown?
I know that startActivityForResult
is an asynchronous call, but I am not sure how it is implemented internally, therefore if the configuration change in Activity A
can occur before Activity B
is shown?
B
takes longer than I would like it to do so I show aProgressBar
. While implementing it, I came up with the question if a configuration change could hide theProgressBar
before ActivityB
is shown. It's more about learning and curiousity than about an practical issue. – RealisticProgressBar
on a configuration change (if that can happen) and not doing so, but I am wondering if it's possible at all that a configuration change can happen. If that's the case, I would implement the few lines for saving and restoring the loading state, otherwise I would skip it ;-) It's more about learning and curiousity of course, asking the question likely took longer than implementing it ;-) – Realistic