Most of the time, the back stack is managed automatically by the framework. You can change certain behaviors with declarations in the manifest or passing flags to intents, but for more advanced stack manipulation, you can use a class named TaskStackBuilder. It lets you build a back stack either from information in the manifest, or entirely using Java code.
- [Instructor] Most of the time the back stack…is managed automatically by the framework.…As I described, you can change certain behaviors…with declarations in the manifest or bypassing…flags to intents.…But for more advanced manipulation of the stack…you can use a class named task stack builder.…In this example, I'm once again working with…an application with three activities.…The main activity and activities two and three.…Activities two and three have parent activity notations.…
Now for this demonstration I'm going to show…what happens when you open one of the other activities,…not the main activity without going through the stack.…This can happen easily on Android.…For example, if you open an activity from a notification…or through a deep link you can sometimes bypass…the launcher activity and go directly to one of…the more nested activities.…To simulate this, I'm going to copy and paste…the intent filter from the main activity…and I'll add it to activity three.…
And this will turn activity three also…into a launcher activity.…
David also shows how to send and receive broadcast messages that let you exchange data and notifications among the different tiers of your application. He demonstrates how to work with menus and the action bar, add a navigation drawer to a layout, and tackle advanced navigation techniques. Later courses in the Essentials series concentrate on other specific skills you can master.
- Working with events
- Handling events with Java objects and lambda expressions
- Managing navigation
- Sending data to an activity
- Opening other apps with implicit intents
- Sending and receiving broadcast messages
- Working with menus and the action bar
- Adding a navigation drawer
- Advanced navigation techniques
- Removing activities from the back stack