I'm not sure if I completely understand this
if I have back to D and press Back Button I will return to C not E
but if I do all you have to do is call finish()
when you are done in E then you will return to D, then to C when you press back in D. If this is not what you are talking about then please clarify your question. But, when you finish()
and Activity
then it is cleared off of the stack so you would never return to E until you start it again. You never would from D anyway by pressing the back button
Google I/O Navigation
In its most basic form, Activities
are put on the stack on top of each other in the way they come in. If you leave one, by calling finish()
or pressing back, then it is removed and you are taken to the one placed before it (where you came from). There is much more to that but that is the very basic of what happens.