Android: Tasks and Shared Preferences - JamesDansie/data-structures-and-algorithms GitHub Wiki

Tasks and Share Preferences

Author: James Dansie

Activities are stored in a back stack. As they move through the app, each activity goes on the "back stack". When the user is done with the activity and presses back, that activity pops off the stack, and goes back to the previous activity. Only the activity on top of the stack is running. All the other activities are stopped, but their state is saved so they can resume later. An activity can be declared as the entry point with the following;

<activity ... >
    <intent-filter ... >
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    ...
</activity>

Shared preferences can be used to store small datasets as key value pairs that can be shared from one app to another.


References

  1. https://developer.android.com/guide/components/activities/tasks-and-back-stack
  2. https://developer.android.com/training/data-storage/shared-preferences#java
⚠️ **GitHub.com Fallback** ⚠️