Java tutorial
//package com.java2s; import android.app.Activity; public class Main { public static final String EXTRA_TAKE_PHOTO = "TAKE_PHOTO_URI"; public static final String EXTRA_TAKE_VIDEO = "TAKE_VIDEO_URI"; public static final int PENDING_STATE_TAKE_PHOTO = 1; public static final int PENDING_STATE_TAKE_VIDEO = 2; public static Object getPendingData(Activity activity, int i) { switch (i) { case PENDING_STATE_TAKE_PHOTO /*1*/: return activity.getIntent().getStringExtra(EXTRA_TAKE_PHOTO); case PENDING_STATE_TAKE_VIDEO /*2*/: return activity.getIntent().getStringExtra(EXTRA_TAKE_VIDEO); default: return null; } } }