Here you can find the source of getUrifromIntent(Intent data, Uri outputFileUri)
public static Uri getUrifromIntent(Intent data, Uri outputFileUri)
//package com.java2s; import android.content.Intent; import android.net.Uri; import android.provider.MediaStore; public class Main { public static Uri getUrifromIntent(Intent data, Uri outputFileUri) { Uri selectedImageUri;/* w w w . j ava 2 s. c o m*/ final boolean isCamera; if (data == null) { isCamera = true; } else { final String action = data.getAction(); if (action == null) { isCamera = false; } else { isCamera = action.equals(MediaStore.ACTION_IMAGE_CAPTURE); } } if (isCamera) { selectedImageUri = outputFileUri; } else { selectedImageUri = data == null ? null : data.getData(); } return selectedImageUri; } }