diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-08-25 14:17:52 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-08-25 14:17:52 +0200 |
commit | b92b6bd421d11a1124023af6c6595662f963d316 (patch) | |
tree | 1fa0d1159fda7f5bb2fc97be537762bef88d16b5 /src/de/danoeh/antennapod/dialog | |
parent | b1911e5ff714354b78279e6cf0def3f06b58959f (diff) | |
download | AntennaPod-b92b6bd421d11a1124023af6c6595662f963d316.zip |
Catch ActivityNotFoundException in VariableSpeedDialog
Exception might be thrown if app runs on an emulator
Diffstat (limited to 'src/de/danoeh/antennapod/dialog')
-rw-r--r-- | src/de/danoeh/antennapod/dialog/VariableSpeedDialog.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/de/danoeh/antennapod/dialog/VariableSpeedDialog.java b/src/de/danoeh/antennapod/dialog/VariableSpeedDialog.java index bcff905d9..e6cbe37d1 100644 --- a/src/de/danoeh/antennapod/dialog/VariableSpeedDialog.java +++ b/src/de/danoeh/antennapod/dialog/VariableSpeedDialog.java @@ -4,6 +4,7 @@ import java.util.Arrays; import java.util.List; import android.app.AlertDialog; +import android.content.ActivityNotFoundException; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; @@ -32,10 +33,15 @@ public class VariableSpeedDialog { new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - Intent playStoreIntent = new Intent( - Intent.ACTION_VIEW, - Uri.parse("market://details?id=com.falconware.prestissimo")); - context.startActivity(playStoreIntent); + try { + Intent playStoreIntent = new Intent( + Intent.ACTION_VIEW, + Uri.parse("market://details?id=com.falconware.prestissimo")); + context.startActivity(playStoreIntent); + } catch (ActivityNotFoundException e) { + // this is usually thrown on an emulator if the Android market is not installed + e.printStackTrace(); + } } }); builder.create().show(); |