Issue 945 don't die if Market isn't there

git-svn-id: https://zxing.googlecode.com/svn/trunk@1887 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2011-08-16 09:26:21 +00:00
parent e669aab2af
commit b27dc8eb28

View file

@ -215,7 +215,12 @@ public final class IntentIntegrator {
public void onClick(DialogInterface dialogInterface, int i) {
Uri uri = Uri.parse("market://search?q=pname:" + PACKAGE);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
activity.startActivity(intent);
try {
activity.startActivity(intent);
} catch (ActivityNotFoundException anfe) {
// Hmm, market is not installed
Log.w(TAG, "Android Market is not installed; cannot install Barcode Scanner");
}
}
});
downloadDialog.setNegativeButton(stringButtonNo, new DialogInterface.OnClickListener() {