问题
The app has 3 activities: A, B and C.
"B" has style=Theme.Dialog, so it can be displayed in a fraction of the screen on top of "A" and "C".
The idea is to show "B" on top while "A" is getting replaced with "C", so the transition between "A" and "C" will appear seamless for user.
Questions:
- is this the right approach (or I should use PopupWindow, etc. instead of activity "B")?
- when activity "C" is launched, "B" is hidden and shown again (onPause/onResume called again) which is looking like "B" is blinking. Is there any way to fix this?
Illustration:
- initial state. "A" launched, "B" is launched on top of "A"
- "A" finished, "B" is still on top
- "C" launched, "B" blinked and brought to front (because of
launchMode="singleInstance"
)

回答1:
I don't think you could avoid "blink" effect on B when A and B are 2 activities.
Perhaps a solution to that would be to merge A and C in same activity. Manage a state to know if new activity in in state A or C.
For instance:
boolean stateA = ...;
if(stateA){
setContentView(R.layout.a);
//use code of A
[...]
}else{
setContentView(R.layout.b);
//use code of B
[...]
}
It seems for me, the easier solution.
来源:https://stackoverflow.com/questions/29130417/two-levels-of-activities-on-android-seamless-transition