mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-26 03:53:09 +08:00
Fix for ticket #58: Certain 1.5/1.6 devices would throw a FileNotFoundException when taking pictures. Patch submitted by Agustin of AVANTIC (thanks!).
This commit is contained in:
parent
ca5e141b5b
commit
4280fdf252
@ -166,7 +166,14 @@ public class CameraLauncher extends Plugin {
|
|||||||
if (resultCode == Activity.RESULT_OK) {
|
if (resultCode == Activity.RESULT_OK) {
|
||||||
try {
|
try {
|
||||||
// Read in bitmap of captured image
|
// Read in bitmap of captured image
|
||||||
Bitmap bitmap = android.provider.MediaStore.Images.Media.getBitmap(this.ctx.getContentResolver(), imageUri);
|
Bitmap bitmap;
|
||||||
|
try {
|
||||||
|
bitmap = android.provider.MediaStore.Images.Media.getBitmap(this.ctx.getContentResolver(), imageUri);
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
Uri uri = intent.getData();
|
||||||
|
android.content.ContentResolver resolver = this.ctx.getContentResolver();
|
||||||
|
bitmap = android.graphics.BitmapFactory.decodeStream(resolver.openInputStream(uri));
|
||||||
|
}
|
||||||
|
|
||||||
// If sending base64 image back
|
// If sending base64 image back
|
||||||
if (destType == DATA_URL) {
|
if (destType == DATA_URL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user