mirror of
https://github.com/apache/cordova-plugin-camera.git
synced 2025-01-19 03:42:52 +08:00
No longer causes a stack trace, but it doesn't cause the error to be called.
This commit is contained in:
parent
a0406b0b1e
commit
fa52e35c42
@ -76,7 +76,7 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
|
|||||||
private static final String GET_PICTURE = "Get Picture";
|
private static final String GET_PICTURE = "Get Picture";
|
||||||
private static final String GET_VIDEO = "Get Video";
|
private static final String GET_VIDEO = "Get Video";
|
||||||
private static final String GET_All = "Get All";
|
private static final String GET_All = "Get All";
|
||||||
|
|
||||||
private static final String LOG_TAG = "CameraLauncher";
|
private static final String LOG_TAG = "CameraLauncher";
|
||||||
|
|
||||||
private int mQuality; // Compression quality hint (0-100: 0=low quality & high compression, 100=compress of max quality)
|
private int mQuality; // Compression quality hint (0-100: 0=low quality & high compression, 100=compress of max quality)
|
||||||
@ -153,15 +153,26 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
|
|||||||
this.targetHeight = -1;
|
this.targetHeight = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (srcType == CAMERA) {
|
try {
|
||||||
this.takePicture(destType, encodingType);
|
if (srcType == CAMERA) {
|
||||||
|
this.takePicture(destType, encodingType);
|
||||||
|
}
|
||||||
|
else if ((srcType == PHOTOLIBRARY) || (srcType == SAVEDPHOTOALBUM)) {
|
||||||
|
this.getImage(srcType, destType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ((srcType == PHOTOLIBRARY) || (srcType == SAVEDPHOTOALBUM)) {
|
catch (IllegalArgumentException e)
|
||||||
this.getImage(srcType, destType);
|
{
|
||||||
|
callbackContext.error("Illegal Argument Exception");
|
||||||
|
PluginResult r = new PluginResult(PluginResult.Status.ERROR);
|
||||||
|
callbackContext.sendPluginResult(r);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginResult r = new PluginResult(PluginResult.Status.NO_RESULT);
|
PluginResult r = new PluginResult(PluginResult.Status.NO_RESULT);
|
||||||
r.setKeepCallback(true);
|
r.setKeepCallback(true);
|
||||||
callbackContext.sendPluginResult(r);
|
callbackContext.sendPluginResult(r);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user