get Input Stream By Uri - Android Network

Android examples for Network:Uri

Description

get Input Stream By Uri

Demo Code


//package com.java2s;

import java.io.InputStream;
import android.content.Context;

import android.net.Uri;

public class Main {

    public static InputStream getInputStreamByUri(Context context, Uri uri) {
        try {//from ww w.  java  2s. c  om
            return context.getContentResolver().openInputStream(uri);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
}

Related Tutorials