Upgrade to Pro — share decks privately, control downloads, hide ads and more …


60c54dec6329cd29ecf6ce8fa2584e6c?s=47 Marina Tanasyuk
September 26, 2020



Marina Tanasyuk

September 26, 2020


  1. Android University - Fall 2020 Week 2: Navigation Flows and

    Passing Data
  2. Online course guidelines Make sure to mute yourself Turn on

    your webcam Use chat room during class Keep an eye on Slack: android-remote-fall20 (general announcements) android-help-fall20 (help) ☕ We’ll take breaks during a session!
  3. 1 week ✅

  4. Week 1 - recap Activity Layout RecyclerView Adapter, ViewHolder, LayoutManager

    Making network requests
  5. Flicks App (Part 2) - what do we need to

    know • How to handle a click • How to start a new activity from the existing activity • How to pass data to this new activity • How to play content
  6. New Concept - Intents Activity A Activity B Intent intent

    = new Intent(ActivityA.this, ActivityB.class); startActivity(intent);
  7. Intents - Pass / Receive Data // in Activity A:

    Intent intent = new Intent(ActivityA.this, ActivityB.class); intent.putExtra("key", "some info to send"); startActivity(intent); // in Activity B: protected void onCreate(Bundle savedInstanceState) { … String data = getIntent().getStringExtra(“key"); // data = “some info to send” … }
  8. New Concept - Activity Lifecycle • As User navigates around

    the app Activity instances transition through different states. • The Activity class provides a number of callbacks. • These callbacks allow the activity to know that a state has changed: that the system is creating, stopping, or resuming an activity, or destroying the process in which the activity resides.
  9. System first creates the activity. Perform basic application startup logic

    that should happen only once for the entire life of the activity. Activity is visible and is active in the foreground. Activity is no longer in the foreground (though it may still be visible. Activity is finishing (due to the user completely dismissing the activity or due to finish() being called on the activity), or the system is temporarily destroying the activity due to a configuration change.
  10. Toolbar vs ActionBar The Toolbar is a successor of the

    ActionBar. The key differences that distinguish the Toolbar from the ActionBar include: • Toolbar is a View included in a layout like any other View. • As a regular View, the toolbar is easier to position, animate and control. • Multiple distinct Toolbar elements can be defined within a single Activity. • Toolbar can be configured as an Activity’s ActionBar, meaning that your standard options menu actions will be displayed within.
  11. Thoughts / Questions

  12. 5 min break

  13. Live Coding (Lab 2) And Breakout Rooms

  14. Next steps