Skip to content

Commit 982719b

Browse files
committed
fix(android): camera crash
1 parent a421b3d commit 982719b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/camera/index.android.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export let takePicture = function (options?): Promise<any> {
9696
values.put(android.provider.MediaStore.MediaColumns.MIME_TYPE, 'image/*');
9797
if (sdkVersionInt >= 29) {
9898
values.put(android.provider.MediaStore.MediaColumns.RELATIVE_PATH, android.os.Environment.DIRECTORY_DCIM);
99-
values.put(android.provider.MediaStore.MediaColumns.IS_PENDING, 1 as any);
99+
values.put(android.provider.MediaStore.MediaColumns.IS_PENDING, java.lang.Integer.valueOf(1));
100100
values.put((android as any).provider.MediaStore.Images.Media.DATE_TAKEN, currentTimeMillis);
101101
}
102102

@@ -109,7 +109,7 @@ export let takePicture = function (options?): Promise<any> {
109109
(org as any).nativescript.plugins.camera.Utils.copy(fis, fos);
110110
if (sdkVersionInt >= 29) {
111111
values.clear();
112-
values.put((android as any).provider.MediaStore.Video.Media.IS_PENDING, 0 as any);
112+
values.put((android as any).provider.MediaStore.Video.Media.IS_PENDING, java.lang.Integer.valueOf(0));
113113
Utils.android.getApplicationContext().contentResolver.update(uri, values, null, null);
114114
}
115115
} catch (e) {

0 commit comments

Comments
 (0)