Skip to content

Instantly share code, notes, and snippets.

View meetmehdi's full-sized avatar
💭
my source code is my baby <3

Syed Raza Mehdi meetmehdi

💭
my source code is my baby <3
View GitHub Profile
@asadfareed777
asadfareed777 / Utils
Created September 4, 2023 07:17
Add these functions in your PickerUtilicty class. It will always open system default camera no matter what camera set as default.
private void captureImageFromCamera() {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File path = AppFolders.getImageFilePath();
if (!path.exists()) {
path.mkdirs();
}
File file = new File(AppFolders.getRandomImageFilePath());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
imageCaptureUri = FileProvider.getUriForFile(mContext, LWMCApplication.getInstance().getPackageName() + ".provider", getRandomFileName());
} else {