Java tutorial
//package com.java2s; import android.app.Activity; public class Main { public static final int REQUEST_CODE_OPEN = 42; public static boolean isOkAndOpen(int requestCode, int resultCode) { return requestCode == REQUEST_CODE_OPEN && resultCode == Activity.RESULT_OK; } }