Android Intent Create getUrifromIntent(Intent data, Uri outputFileUri)

Here you can find the source of getUrifromIntent(Intent data, Uri outputFileUri)

Description

get Urifrom Intent

Declaration

public static Uri getUrifromIntent(Intent data, Uri outputFileUri) 

Method Source Code

//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;
    }
}

Related

  1. intentDIY(Activity activity, Class classes)
  2. intentDIY(Activity activity, Class classes, Map paramMap)
  3. intentDIY(Activity activity, Class classes, int enterAnim, int exitAnim)
  4. intentDIY(Activity activity, Class classes, Map paramMap, int enterAnim, int exitAnim)
  5. getCameraIntent(String outputFile)
  6. createContactAppIntent()
  7. sendBroadcast(Context c, Intent i, boolean local)
  8. sendUpdateCallerInfoCacheIntent(Context context)
  9. getGalleryIntent()