Code example for Dialog

Methods: dismiss

                public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                    Intent intent = new Intent();
                    intent.putExtra(RESOURCE_NAME, adapter.getItemReference(position));
                    mIconListener.iconPicked(type, Activity.RESULT_OK, intent);
        } else if (type == REQUEST_PICK_GALLERY) {
            Intent intent = new Intent(Intent.ACTION_GET_CONTENT, null);
            intent.putExtra("crop", "true");
            intent.putExtra("scale", true);
            intent.putExtra("scaleUpIfNeeded", false);
            intent.putExtra("outputFormat", Bitmap.CompressFormat.PNG.toString());
            intent.putExtra("aspectX", 1);
            intent.putExtra("aspectY", 1);
            intent.putExtra("outputX", 162);
            intent.putExtra("outputY", 162);
Connect your IDE to all the code out there  Get Codota for Java