diff options
author | Gabriele M <moto.falcon.git@gmail.com> | 2016-03-29 21:41:43 +0200 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-03-30 09:32:42 -0700 |
commit | f9e74ef062907f14915e7ddf91286309a93d337f (patch) | |
tree | ef7793548393dc87da94154636c10d50f3a8325d | |
parent | 91b8baebb920e03210eebb7de64b9fa83f1c9a8d (diff) | |
download | android_packages_apps_FMRadio-f9e74ef062907f14915e7ddf91286309a93d337f.tar.gz android_packages_apps_FMRadio-f9e74ef062907f14915e7ddf91286309a93d337f.tar.bz2 android_packages_apps_FMRadio-f9e74ef062907f14915e7ddf91286309a93d337f.zip |
Fix force close when Google Play Music is not installed
setClassName() throws IllegalArgumentException if
com.google.android.music is not found.
Change-Id: Ied2d2fade6aeaa7550503bb360477feb66be00cc
-rw-r--r-- | src/com/android/fmradio/FmMainActivity.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/android/fmradio/FmMainActivity.java b/src/com/android/fmradio/FmMainActivity.java index 97fdfe2..82db51b 100644 --- a/src/com/android/fmradio/FmMainActivity.java +++ b/src/com/android/fmradio/FmMainActivity.java @@ -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"); |