在模拟器中保存照片时出错 - Android Studio

时间:2018-04-18 20:39:30

标签: android android-emulator

每次我用模拟器拍照并点击保存,相机应用程序停止工作,它返回正常活动并在logcat中出现此错误,这不是我的应用程序停止工作,它是相机在我点击保存照片的那一刻。

API等级16

  

04-18 20:35:39.961 1913-2390 / insidetechnology.studio.ostdor.xiope E / FA:无法将当前屏幕发送到服务

     

04-18 20:35:42.701 1913-2390 / insidetechnology.studio.ostdor.xiope E / FA:无法将当前屏幕发送到服务

     

04-18 20:35:42.711 1913-2390 / insidetechnology.studio.ostdor.xiope E / FA:丢弃数据。无法将事件发送到服务

     

04-18 20:35:45.311 1913-1913 / insidetechnology.studio.ostdor.xiope E / EGL_emulation:tid 1913:eglSurfaceAttrib(1199):错误0x3009(EGL_BAD_MATCH)

     

04-18 20:35:45.341 1913-2390 / insidetechnology.studio.ostdor.xiope E / FA:无法将当前屏幕发送到服务

有谁知道如何解决或可以做什么? 在真正的手机上它完美无缺。

保存图片:

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == CAPTURE_PHOTO) {
        if (resultCode == RESULT_OK) {

            String imagePath = photoFile.getAbsolutePath();

            ocorrencia.arImagens.add(0, imagePath.split(" "));

            PicturesAdapter adapter = (PicturesAdapter) mRecyclerView.getAdapter();
            pictures p = new pictures(imagePath);
            adapter.addListItem(p, mList.size());

        } else if (resultCode != RESULT_CANCELED) {
            Log.e(TAG, "Error while taking a photo. Error " + resultCode);
        }
    }
}

0 个答案:

没有答案