diff --git a/src/org/kde/kdeconnect/Plugins/MprisPlugin/MprisActivity.java b/src/org/kde/kdeconnect/Plugins/MprisPlugin/MprisActivity.java index e9036e34..9aaa4071 100644 --- a/src/org/kde/kdeconnect/Plugins/MprisPlugin/MprisActivity.java +++ b/src/org/kde/kdeconnect/Plugins/MprisPlugin/MprisActivity.java @@ -145,6 +145,11 @@ public class MprisActivity extends AppCompatActivity { } }); + if (targetPlayer == null) { + //If no player is selected, try to select a playing player + targetPlayer = mpris.getPlayingPlayer(); + } + //Try to select the specified player if (targetPlayer != null) { int targetIndex = adapter.getPosition(targetPlayer.getPlayer()); if (targetIndex >= 0) { @@ -153,6 +158,11 @@ public class MprisActivity extends AppCompatActivity { targetPlayer = null; } } + //If no player selected, select the first one (if any) + if (targetPlayer == null && !playerList.isEmpty()) { + targetPlayer = mpris.getPlayerStatus(playerList.get(0)); + spinner.setSelection(0); + } updatePlayerStatus(mpris); } });