get MediaStore Video Uri - Android Media

Android examples for Media:Video

Description

get MediaStore Video Uri

Demo Code


//package com.java2s;

import android.database.Cursor;

import android.net.Uri;

import android.provider.MediaStore.MediaColumns;
import android.provider.MediaStore.Video;

public class Main {
    public static Uri getVideoUri(Cursor cursor) {
        return getMediaUri(cursor, Video.Media.EXTERNAL_CONTENT_URI);
    }//w w  w. jav a2s  . c o  m

    public static Uri getMediaUri(Cursor cursor, Uri uri) {
        String id = cursor.getString(cursor
                .getColumnIndex(MediaColumns._ID));
        return Uri.withAppendedPath(uri, id);
    }
}

Related Tutorials