reading-notes


Project maintained by sanaa-almoghraby Hosted on GitHub Pages — Theme by mattgraham

Tasks and the back stack

A task is a collection of activities that users interact with when trying to do something in your app. These activities are arranged in a stack—the back stack—in the order in which each activity is opened.

Lifecycle of a task and its back stack

Back press behavior for root launcher activities

Root launcher activities are activities that declare an Intent filter with both ACTION_MAIN and CATEGORY_LAUNCHER. These activities are unique because they act as entry points into your app from the app launcher and are used to start a task.

Multiple activity instances

Multi-window environments

In this regard, these are the principal attributes that you can use:

Defining launch modes

Launch modes allow you to define how a new instance of an activity is associated with the current task.

Get a handle to shared preferences

Write to shared preferences

To write to a shared preferences file, create a SharedPreferences.Editor by calling edit() on your SharedPreferences.

Pass the keys and values you want to write with methods such as putInt() and putString().