diff --git a/CatchNotesIntegration/src/com/catchnotes/samples/integration/IntentTestActivity.java b/CatchNotesIntegration/src/com/catchnotes/samples/integration/IntentTestActivity.java index 3d807f9..f557e79 100644 --- a/CatchNotesIntegration/src/com/catchnotes/samples/integration/IntentTestActivity.java +++ b/CatchNotesIntegration/src/com/catchnotes/samples/integration/IntentTestActivity.java @@ -50,8 +50,10 @@ public void onClick(View v) { public void onClick(View v) { Intent galleryIntent = new Intent(Intent.ACTION_PICK); galleryIntent.setType("image/*"); - startActivityForResult(Intent.createChooser(galleryIntent, - "Choose from:"), IMAGE_PICKED); + if(galleryIntent.resolveActivity(getPackageManager()) != null){ + startActivityForResult(Intent.createChooser(galleryIntent, + "Choose from:"), IMAGE_PICKED); + } } }); @@ -123,4 +125,4 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); } -} \ No newline at end of file +}