Image Loader / Explorer Dialog Box (Processing for Android)

Edit: You must give Read permission!

Following short code will let you choose your favorite Image Explorer, where you can select your file which will be loaded in the pixels[] array.
Please comment if any error.

import android.net.Uri;
import android.database.Cursor;
import android.content.Intent;
import android.provider.MediaStore;
import android.app.Activity;
import android.content.Context;

Activity act;
Context mC;
PImage img;
boolean img_loaded;

void settings() {
  fullScreen();
}

void setup() {
  background(#F9C454);
  fill(#4A3A16);
  textSize(38);
  textAlign(CENTER);
  text("Click on screen", width/2, height/3);
  act = this.getActivity();
  mC= act.getApplicationContext();
}

void draw() {
  if (img_loaded)  image(img, 0, 0);
}

void mousePressed() {  
  searchImage();
}

public void searchImage() {
  Intent intent = new Intent(Intent.ACTION_PICK, 
    android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
  intent.setType("image/*");
  act.startActivityForResult(intent, 1);
}

@Override 
  void onActivityResult(int requestCode, int resultCode, Intent data) {
  super.onActivityResult(requestCode, resultCode, data);
  if (requestCode == 1) {
    if (resultCode == Activity.RESULT_OK) {
      if (data != null) {
        Uri selectedImage = data.getData();
        String[] filePathColumn = { MediaStore.Images.Media.DATA };
        Cursor cursor = mC.getContentResolver().query(selectedImage, 
          filePathColumn, null, null, null);
        cursor.moveToFirst();
        int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
        String imgDecodableString = cursor.getString(columnIndex);
        cursor.close();
        println( imgDecodableString);
        img = loadImage( imgDecodableString);
        img_loaded = true;
      } else {
        println("Cancelled");
      }
    }
  }
}

!