ExoPlayer Short Tip 3: Handle the Android Lifecycle

This is the third instalment of ExoPlayer Short Tip.

This one is straightforward.

We will obtain the following behaviour:

  • If our app goes into background, the player is paused if it was playing.
  • If the player was paused, it remains paused when coming back from the background.
  • If the player was playing, it unpauses our player.