use of net.iGap.module.AttachFile in project iGap-Android by KianIranian-STDG.
the class FragmentUserProfile method useCamera.
private void useCamera() {
if (getActivity() != null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
new AttachFile(getActivity()).dispatchTakePictureIntent(FragmentUserProfile.this);
} else {
if (getActivity().getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_ANY)) {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(viewModel.getImageFile()));
startActivityForResult(intent, AttachFile.request_code_TAKE_PICTURE);
} else {
Toast.makeText(getContext(), R.string.please_check_your_camera, Toast.LENGTH_SHORT).show();
}
}
}
}
Aggregations