show images in the android device media store using Intent - Android android.media

Android examples for android.media:Media

Description

show images in the android device media store using Intent

Demo Code

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;

public class Main{

    /**//from  ww  w.  java  2  s . c o m
     * show images in the android device media store
     */
    public static void showPictures(Activity a, int type) {
        Intent innerIntent = new Intent(Intent.ACTION_GET_CONTENT);
        String IMAGE_UNSPECIFIED = "image/*";
        innerIntent.setType(IMAGE_UNSPECIFIED); 
        Intent wrapperIntent = Intent.createChooser(innerIntent, null);
        a.startActivityForResult(wrapperIntent, type);
    }

}

Related Tutorials