Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f9e74ef0 authored by Gabriele M's avatar Gabriele M Committed by Gerrit Code Review
Browse files

Fix force close when Google Play Music is not installed

setClassName() throws IllegalArgumentException if
com.google.android.music is not found.

Change-Id: Ied2d2fade6aeaa7550503bb360477feb66be00cc
parent 91b8baeb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -826,7 +826,7 @@ public class FmMainActivity extends Activity implements FmFavoriteEditDialog.Edi
                            "com.google.android.music.ui.TrackContainerActivity");
                    playMusicIntent.setType("vnd.android.cursor.dir/playlist");
                    startActivity(playMusicIntent);
                } catch (ActivityNotFoundException e1) {
                } catch (IllegalArgumentException | ActivityNotFoundException e1) {
                    try {
                        playMusicIntent = new Intent(Intent.ACTION_VIEW);
                        playMusicIntent.putExtras(extras);
@@ -883,7 +883,7 @@ public class FmMainActivity extends Activity implements FmFavoriteEditDialog.Edi
                                        "com.google.android.music.AudioPreview");
                                playMusicIntent.setDataAndType(playUri, "audio/3gpp");
                                startActivity(playMusicIntent);
                            } catch (ActivityNotFoundException e1) {
                            } catch (IllegalArgumentException | ActivityNotFoundException e1) {
                                try {
                                    playMusicIntent = new Intent(Intent.ACTION_VIEW);
                                    playMusicIntent.setDataAndType(playUri, "audio/3gpp");