Why does my iPhone select a random song when I connect my headphones? Like many other people, I listen to music on my iPhone (6S, iOS 10.0.2) on my way to work. Since the update to iOS 10, I have noticed the following annoying behavior:

When I plug my headphones into my phone, the "Music" app selects a random song from my collection and wants to play that. It doesn't start playing it, but shows the song in the lock screen, waiting for me to press the Play button. I find this really annoying because I would expect to still be at the song that I was listening to last.

Is there a way to change this behavior to my expected behavior (the song I last listened to is selected when I insert my headphones)? From what I remember, that was the default behavior in iOS 9.
This bug was introduced in iOS 10, and the same thing happens when you ask Siri to “play music,” or even if you pull up the Control Center’s playback controls.

If you Pause, then Resume only a short while later, the app remembers where you were. But leave it be for an hour or two, and it will forget. At that point it will try to shuffle your entire library when you start music playback.

If you open the Music app, it will suddenly remember which song or playlist you were playing last, and you can Play from there.

Until Apple fixes it, I’m afraid that’s the only workaround.

Edit: I haven’t encountered this issue since iOS 10.1.1.