|
@@ -1095,7 +1095,6 @@ public class MainActivity extends BaseActivity {
|
|
|
Log.e("takePhoto","------>保存成功");
|
|
|
Log.e("takePhoto","------>重试数:" + retryCount);
|
|
|
retryCount = 0;
|
|
|
-// Toast.makeText(MainActivity.this, "保存成功", Toast.LENGTH_SHORT).show();
|
|
|
savePicture(file, path, name);
|
|
|
mWebView.loadUrl("javascript:uploadPhotoPath('" + outputFileOptions.getFile().getAbsolutePath() + "')");
|
|
|
}
|
|
@@ -1104,10 +1103,10 @@ public class MainActivity extends BaseActivity {
|
|
|
public void onError(@NonNull ImageCaptureException exception) {
|
|
|
Log.e("takePhoto","------>保存失败: "+exception.getMessage());
|
|
|
Log.e("takePhoto","------>重试数:" + retryCount);
|
|
|
- if (retryCount < maxRetries) {
|
|
|
- retryCount++;
|
|
|
- // 重试拍照
|
|
|
- if(imageCapture != null) {
|
|
|
+ if(imageCapture != null) {
|
|
|
+ if (retryCount < maxRetries) {
|
|
|
+ retryCount++;
|
|
|
+ // 重试拍照
|
|
|
imageCapture.takePicture(
|
|
|
// 第一个参数 OutputFileOptions 指定了照片保存的位置和格式等信息。
|
|
|
outputFileOptions,
|