Skip to content

Instantly share code, notes, and snippets.

@sunwicked
Created October 5, 2013 13:14
Show Gist options
  • Select an option

  • Save sunwicked/6840823 to your computer and use it in GitHub Desktop.

Select an option

Save sunwicked/6840823 to your computer and use it in GitHub Desktop.
Mixing intents from manning android 50 hacks https://github.com/Macarse/50AH-code
public void onPickBoth(View v) {
Intent pickIntent = new Intent(Intent.ACTION_GET_CONTENT);
pickIntent.setType("image/*");
Intent takePhotoIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
Intent chooserIntent = Intent.createChooser(pickIntent,
getString(R.string.activity_main_pick_both));
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS,
new Intent[] { takePhotoIntent });
startActivityForResult(chooserIntent, PICK_OR_TAKE_PICTURE);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment