Tasks and the Back Stack (Android Development Patterns)

Android Developers · 145K views · 2016 · 4:11

Open on YouTube

Software (other)Software architecture & designtutorial

Why Stack Overflow recommends it

Stack Overflow users link it when answering questions about Android tasks, the back stack, up navigation and synthesizing a back stack for deep links.

Recommended by 3 people across 3 different months, 2016 to 2020.

What it is

A short Android Developers video in the Android Development Patterns series where Ian Lake explains that a task is a stack of activities and how the back button interacts with activities and fragments added via addToBackStack(). It also covers the SINGLE_TOP launch mode and using TaskStackBuilder for notifications that deep link into an app.

What people said

Recommends pablobu · 2016-07 · Stack Overflow · on “Up Navigation not launching parent activity”

Try the approach described for Synthesize a new Back Stack for Deep Links [LINK] You will have use TaskStackBuild to build the back stack and get the PendingIntent when starting on Activity B. Check this [this video] video from Android Design Patterns explains it simple.

Recommends Efe Budak · 2018-11 · Stack Overflow · on “How can I manage activities like fragments stack”

I would recommend watching this video; [this video] What you want can be done easily with fragments. Here is another related doc you should definitely read. [LINK]

Recommends SowlM · 2020-10 · Stack Overflow · on “Why does clicking on UP then BACK in GMail App result in returning to Home screen and not My Android App”

The Back Key is always managged programically and is used to bring back user from other Avtivity or Fragmnet to the MainPage and it's part of the UI/UX design. Most of the time the Back Key is just a replica of Up Key , like in Gmail app that when ever you navigate to a secondry Activity/Fragment a back key appear some where (Mostly top left of the screen) to help you navigate back to the Main Screen. What you really need to do is to Implement Custom Back Navigation for Up Key . To achive this goal you should understand the concept of Android Tasks and Back Stack, A task is a collection of activities that users interact with when performing a certain job. The activities are arranged in a sta

Cites apksherlock · 2019-08 · Stack Overflow · on “Android Task vs. Activity - What are they "really"?”

Task s are just stacks that hold Activities . Also Activities just hold the UI and and become a part of that Stack. Source: Tasks and the Back Stack (Android Development Patterns) [this video] Same applies to Fragment s inside Activities . Just like they are part of the Activity backstack, Activities are part of the stack called Task (s). When you press the overview button or home button, what you see is not the Activity but a Task with the latest Activity on top. Source for that: Single Activity, why , when and how. [LINK] So to answer your question: Is this accurate or am I off-base? That's a concept which is used in Linux, not Android specific related (even tho Android is Linux). So different