How to get back to root Activity from Java Code ? (Android)
Im creating activities as followi开发者_JAVA技巧ng.
A->B->C->D
When i click a button in D i need to go back to the home screen (which is A).
Can anyone suggest me some code to do this.
Do you need to go to android home screen? Then it is a different thing.
But if 'A' is the main activity of your application, then you can call activity 'A' with FLAG_ACTIVITY_CLEAR_TOP. This will clear all activity above 'A' and make top of stack.
Take a look at the Tasks and Back Stack topic in the dev guide.
精彩评论