Android 为什么相机意图的结果会崩溃,但只是在三星Galaxy4上?

Android 为什么相机意图的结果会崩溃,但只是在三星Galaxy4上?,android,android-intent,itext,onactivityresult,Android,Android Intent,Itext,Onactivityresult,我有一个正在运行的车辆检查应用程序,三星Galaxy 4除外。用户使用照相机拍摄照片,选择ok,然后在ActivityResult上崩溃。如您所见,我在代码后面使用iText创建PDF,但我创建了iText图像。有人对这个具体问题有线索吗 protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCod

我有一个正在运行的车辆检查应用程序,三星Galaxy 4除外。用户使用照相机拍摄照片,选择ok,然后在ActivityResult上崩溃。如您所见,我在代码后面使用iText创建PDF,但我创建了iText图像。有人对这个具体问题有线索吗

 protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    tireTreadImageView = (ImageView) findViewById(id.tire_tread_image);
    insideVanCleanImageView = (ImageView) findViewById(id.inside_van_clean_image_view);
    windshieldConditionImageView = (ImageView) findViewById(id.windshield_image_view);
    Bitmap bitmap;
    BitmapFactory.Options bitmapOptions = new BitmapFactory.Options();
    File f;
    ByteArrayOutputStream bmpStream = new ByteArrayOutputStream();

    if (resultCode == RESULT_OK) {

        switch (requestCode) {
            case TIRE_TREAD_CAMERA_INTENT:
                f = new File(Environment.getExternalStorageDirectory().getAbsolutePath(), "temp_tire_tread.jpg");
                bitmap = BitmapFactory.decodeFile(f.toString(), bitmapOptions);
                //imageCaptured = (Bitmap) data.getExtras().get("data");
                tireTreadImageView.setImageBitmap(bitmap);
                tireTreadImage = bitmap;

                tireTreadImage.compress(Bitmap.CompressFormat.JPEG, 15, bmpStream);

                try {
                    tireTreadCellImage = Image.getInstance(bmpStream.toByteArray());
                } catch (BadElementException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                }

                break;

            case VAN_CLEAN_CAMERA_INTENT:
                f = new File(Environment.getExternalStorageDirectory().getAbsolutePath(), "temp_van_clean.jpg");
                bitmap = BitmapFactory.decodeFile(f.toString(), bitmapOptions);
                //imageCaptured = (Bitmap) data.getExtras().get("data");
                insideVanCleanImageView.setImageBitmap(bitmap);
                insideVanCleanImage = bitmap;

                insideVanCleanImage.compress(Bitmap.CompressFormat.JPEG, 15, bmpStream);

                try {
                    insideVanCleanCellImage = Image.getInstance(bmpStream.toByteArray());
                } catch (BadElementException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                }

                break;

            case WINDSHIELD_CAMERA_INTENT:
                f = new File(Environment.getExternalStorageDirectory().getAbsolutePath(), "temp_windshield.jpg");
                bitmap = BitmapFactory.decodeFile(f.toString(), bitmapOptions);
                //imageCaptured = (Bitmap) data.getExtras().get("data");
                windshieldConditionImageView.setImageBitmap(bitmap);
                windshieldImage = bitmap;

                windshieldImage.compress(Bitmap.CompressFormat.JPEG, 15, bmpStream);

                try {
                    windshieldConditionCellImage = Image.getInstance(bmpStream.toByteArray());
                } catch (BadElementException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                }

                break;
        }
    }
    bmpStream.reset();
}

正如塞巴斯蒂安所说,你应该设法找到更多关于这个问题的信息。这里有一些关于相关问题/答案的讨论:


希望有帮助,

发布崩溃的堆栈跟踪。不幸的是,我没有它。它来自无法向我发送此信息的用户。我希望有人以前看到过这一点,并能提供一个建议……如果没有日志,您将很难调试它。您至少有3个选项:1)如果应用程序已发布,请从Google Play崩溃报告中获取堆栈跟踪2)使用第三方崩溃分析SDK,如Crashlytics 3)获取Galaxy S4以再现崩溃