: public static void takePhoto(Fragment fragment, int token, Uri uri) {     Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);     if (uri != null) {         intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);     }     fragment.startActivityForResult(intent, token); }  