Problem when showing photo in an imageview

3

I am developing an application where I have an option to capture a photo with the camera and upload it to my server.

Well I told you the following, the application worked very well, I could take the photo and upload it to my server, but I realize that it no longer shows me the image captured in my ImageView , so I can not upload it to my server, and the weird thing is that it did not move anything!

Note: Before this happened I had to take the picture with a resolution of less than 4000, so that it could be displayed in my ImageView , but now the resolution does not matter, anyway it is not displayed.

I leave my code:

fab.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        showOptions();
    }
});
private void showOptions(){
    final CharSequence[] option = {"Tomar foto", "Elegir de galeria", "Cancelar"};
    final AlertDialog.Builder builder = new AlertDialog.Builder(Modificar.this);
    builder.setTitle("Elige una opción");
    builder.setItems(option, new DialogInterface.OnClickListener() {

        @Override
            public void onClick(DialogInterface dialog, int which) {
            if(option[which] == "Tomar foto"){
                getCamara();
            }else if(option[which] == "Elegir de galeria"){
                Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
                intent.setType("image/*");
                startActivityForResult(intent.createChooser(intent, "Selecciona app de imagen"), SELECT_PICTURE);
            }else {
                dialog.dismiss();
            }
        }
    });
    builder.show();
}
private void getCamara(){
    File file = new File(Environment.getExternalStorageDirectory(), MEDIA_DIRECTORY);
    boolean isDirectoryCreated = file.exists();

    if(!isDirectoryCreated)
    isDirectoryCreated = file.mkdirs();

    if(isDirectoryCreated){
        Long timestamp = System.currentTimeMillis() / 1000;
        imageName = timestamp.toString() + ".jpg";

        mPath = Environment.getExternalStorageDirectory() + File.separator + MEDIA_DIRECTORY
        + File.separator + imageName;

        newFile = new File(mPath);

        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
        intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(newFile));
        startActivityForResult(intent, PHOTO_CODE);
    }
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if(resultCode == RESULT_OK){
    switch (requestCode){
        case PHOTO_CODE:
            MediaScannerConnection.scanFile(this,
            new String[]{mPath}, null,
            new MediaScannerConnection.OnScanCompletedListener() {

                @Override
                public void onScanCompleted(String path, Uri uri) {
                    Log.i("ExternalStorage", "Scanned " + path + ":");
                    Log.i("ExternalStorage", "-> Uri = " + uri);
                }
            });
            Bitmap bitmap = BitmapFactory.decodeFile(mPath);
            imagen.setImageBitmap(bitmap);
            nombreImagen.setText(imageName);
            subir.setEnabled(true);
        break;
        case SELECT_PICTURE:
            Uri path = data.getData();
            imagen.setImageURI(path);
            nombreImagen.setText(imageName);
            break;
        }
    }
}

This is the LogCat that I receive:

05-17 12:31:02.594 23136-23136/mx.gob.lahuerta.oficiadepartes I/libpersona: KNOX_SDCARD checking this for 10219
05-17 12:31:02.594 23136-23136/mx.gob.lahuerta.oficiadepartes I/libpersona: KNOX_SDCARD not a persona
05-17 12:31:02.674 23136-23136/mx.gob.lahuerta.oficiadepartes W/ResourcesManager: getTopLevelResources: /data/app/mx.gob.lahuerta.oficiadepartes-2/base.apk / 1.0 running in mx.gob.lahuerta.oficiadepartes rsrc of package null
05-17 12:31:03.624 23136-23136/mx.gob.lahuerta.oficiadepartes W/ResourcesManager: getTopLevelResources: /data/app/mx.gob.lahuerta.oficiadepartes-2/base.apk / 1.0 running in mx.gob.lahuerta.oficiadepartes rsrc of package null
05-17 12:31:03.624 23136-23136/mx.gob.lahuerta.oficiadepartes W/ResourcesManager: getTopLevelResources: /data/app/mx.gob.lahuerta.oficiadepartes-2/base.apk / 1.0 running in mx.gob.lahuerta.oficiadepartes rsrc of package null

05-17 12:31:03.764 23136-23136/mx.gob.lahuerta.oficiadepartes D/SecWifiDisplayUtil: Metadata value : none
05-17 12:31:02.594 23136-23136/mx.gob.lahuerta.oficiadepartes E/Zygote: v2
05-17 12:31:02.594 23136-23136/mx.gob.lahuerta.oficiadepartes I/SELinux: Function: selinux_compare_spd_ram, index[1], SPD-policy is existed. and_ver=SEPF_SECMOBILE_6.0.1 ver=11

05-17 12:31:02.594 23136-23136/mx.gob.lahuerta.oficiadepartes W/SELinux: Function: selinux_compare_spd_ram, index[1], priority [2], priority version is VE=SEPF_SECMOBILE_6.0.1_0029
05-17 12:31:02.594 23136-23136/mx.gob.lahuerta.oficiadepartes E/Zygote: accessInfo : 0
05-17 12:31:02.594 23136-23136/mx.gob.lahuerta.oficiadepartes W/SELinux: SELinux: seapp_context_lookup: seinfo=default, level=s0:c512,c768, pkgname=mx.gob.lahuerta.oficiadepartes 
05-17 12:31:02.594 23136-23136/mx.gob.lahuerta.oficiadepartes I/art: Late-enabling -Xcheck:jni
05-17 12:31:02.634 23136-23136/mx.gob.lahuerta.oficiadepartes D/TimaKeyStoreProvider: TimaSignature is unavailable
05-17 12:31:02.634 23136-23136/mx.gob.lahuerta.oficiadepartes D/ActivityThread: Added TimaKeyStore provider
05-17 12:31:02.754 23136-23136/mx.gob.lahuerta.oficiadepartes W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/data/app/mx.gob.lahuerta.oficiadepartes-2/split_lib_dependencies_apk.apk --oat-file=/data/dalvik-cache/arm/[email protected]@[email protected][email protected]) because non-0 exit status
05-17 12:31:03.024 23136-23136/mx.gob.lahuerta.oficiadepartes W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/data/app/mx.gob.lahuerta.oficiadepartes-2/split_lib_slice_0_apk.apk --oat-file=/data/dalvik-cache/arm/[email protected]@[email protected]_li[email protected]) because non-0 exit status
05-17 12:31:03.084 23136-23136/mx.gob.lahuerta.oficiadepartes W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/data/app/mx.gob.lahuerta.oficiadepartes-2/split_lib_slice_1_apk.apk --oat-file=/data/dalvik-cache/arm/[email protected]@[email protected][email protected]) because non-0 exit status
05-17 12:31:03.144 23136-23136/mx.gob.lahuerta.oficiadepartes W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/data/app/mx.gob.lahuerta.oficiadepartes-2/split_lib_slice_2_apk.apk --oat-file=/data/dalvik-cache/arm/[email protected]@[email protected][email protected]) because non-0 exit status
05-17 12:31:03.204 23136-23136/mx.gob.lahuerta.oficiadepartes W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/data/app/mx.gob.lahuerta.oficiadepartes-2/split_lib_slice_3_apk.apk --oat-file=/data/dalvik-cache/arm/[email protected]@[email protected][email protected]) because non-0 exit status
05-17 12:31:03.264 23136-23136/mx.gob.lahuerta.oficiadepartes W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/data/app/mx.gob.lahuerta.oficiadepartes-2/split_lib_slice_4_apk.apk --oat-file=/data/dalvik-cache/arm/[email protected]@[email protected][email protected]) because non-0 exit status
05-17 12:31:03.314 23136-23136/mx.gob.lahuerta.oficiadepartes W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/data/app/mx.gob.lahuerta.oficiadepartes-2/split_lib_slice_5_apk.apk --oat-file=/data/dalvik-cache/arm/[email protected]@[email protected][email protected]) because non-0 exit status
05-17 12:31:03.374 23136-23136/mx.gob.lahuerta.oficiadepartes W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/data/app/mx.gob.lahuerta.oficiadepartes-2/split_lib_slice_6_apk.apk --oat-file=/data/dalvik-cache/arm/[email protected]@[email protected][email protected]) because non-0 exit status
05-17 12:31:03.424 23136-23136/mx.gob.lahuerta.oficiadepartes W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/data/app/mx.gob.lahuerta.oficiadepartes-2/split_lib_slice_7_apk.apk --oat-file=/data/dalvik-cache/arm/[email protected]@[email protected][email protected]) because non-0 exit status
05-17 12:31:03.484 23136-23136/mx.gob.lahuerta.oficiadepartes W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/data/app/mx.gob.lahuerta.oficiadepartes-2/split_lib_slice_8_apk.apk --oat-file=/data/dalvik-cache/arm/[email protected]@[email protected][email protected]) because non-0 exit status
05-17 12:31:03.544 23136-23136/mx.gob.lahuerta.oficiadepartes W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg  --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/data/app/mx.gob.lahuerta.oficiadepartes-2/split_lib_slice_9_apk.apk --oat-file=/data/dalvik-cache/arm/[email protected]@[email protected][email protected]) because non-0 exit status
05-17 12:31:03.544 23136-23136/mx.gob.lahuerta.oficiadepartes W/System: ClassLoader referenced unknown path: /data/app/mx.gob.lahuerta.oficiadepartes-2/lib/arm
05-17 12:31:03.554 23136-23136/mx.gob.lahuerta.oficiadepartes I/InstantRun: starting instant run server: is main process
05-17 12:31:03.654 23136-23136/mx.gob.lahuerta.oficiadepartes W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
05-17 12:31:03.764 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{1d2eeb5 I.E...... R.....ID 0,0-0,0}
05-17 12:31:03.774 23136-23186/mx.gob.lahuerta.oficiadepartes D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
05-17 12:31:03.804 23136-23186/mx.gob.lahuerta.oficiadepartes I/Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: EGL 1.4 QUALCOMM build:  (Ia10634f51b)
                                                                            OpenGL ES Shader Compiler Version: E031.29.00.00
                                                                            Build Date: 01/28/16 Thu
                                                                            Local Branch: ss
                                                                            Remote Branch: 
                                                                            Local Patches: 
                                                                            Reconstruct Branch: 
05-17 12:31:03.814 23136-23186/mx.gob.lahuerta.oficiadepartes D/libEGL: eglInitialize EGLDisplay = 0xa00f97c4
05-17 12:31:03.814 23136-23186/mx.gob.lahuerta.oficiadepartes I/OpenGLRenderer: Initialized EGL, version 1.4
05-17 12:31:03.844 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 72 - 0, 0) vi=Rect(0, 72 - 0, 0) or=1
05-17 12:31:03.854 23136-23136/mx.gob.lahuerta.oficiadepartes W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
05-17 12:31:06.774 23136-23136/mx.gob.lahuerta.oficiadepartes I/Timeline: Timeline: Activity_launch_request id:mx.gob.lahuerta.oficiadepartes time:9757265
05-17 12:31:06.834 23136-23136/mx.gob.lahuerta.oficiadepartes W/ResourcesManager: getTopLevelResources: /data/app/mx.gob.lahuerta.oficiadepartes-2/base.apk / 1.0 running in mx.gob.lahuerta.oficiadepartes rsrc of package null
05-17 12:31:06.984 23136-23136/mx.gob.lahuerta.oficiadepartes D/SecWifiDisplayUtil: Metadata value : none
05-17 12:31:06.984 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{cb8a12d I.E...... R.....ID 0,0-0,0}
05-17 12:31:07.074 23136-23136/mx.gob.lahuerta.oficiadepartes W/art: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
05-17 12:31:07.104 23136-23136/mx.gob.lahuerta.oficiadepartes W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
05-17 12:31:07.104 23136-23136/mx.gob.lahuerta.oficiadepartes W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
05-17 12:31:07.104 23136-23136/mx.gob.lahuerta.oficiadepartes W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
05-17 12:31:07.154 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 72 - 0, 0) vi=Rect(0, 72 - 0, 0) or=1
05-17 12:31:07.174 23136-23136/mx.gob.lahuerta.oficiadepartes W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
05-17 12:31:07.174 23136-23136/mx.gob.lahuerta.oficiadepartes W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
05-17 12:31:07.194 23136-23136/mx.gob.lahuerta.oficiadepartes I/Timeline: Timeline: Activity_idle id: [email protected] time:9757683
05-17 12:31:07.474 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: #3 mView = null
05-17 12:31:08.574 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: ViewPostImeInputStage processPointer 0
05-17 12:31:08.614 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: ViewPostImeInputStage processPointer 1
05-17 12:31:08.664 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{b8d603b V.E...... R.....I. 0,0-0,0}
05-17 12:31:08.694 23136-23251/mx.gob.lahuerta.oficiadepartes I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
05-17 12:31:08.694 23136-23251/mx.gob.lahuerta.oficiadepartes I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
05-17 12:31:08.744 23136-23136/mx.gob.lahuerta.oficiadepartes W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
05-17 12:31:08.764 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
05-17 12:31:08.894 23136-23251/mx.gob.lahuerta.oficiadepartes I/qtaguid: Tagging socket 42 with tag 30b3e9b100000000{817097137,0} uid -1, pid: 23136, getuid(): 10219
05-17 12:31:09.604 23136-23251/mx.gob.lahuerta.oficiadepartes I/qtaguid: Untagging socket 42
05-17 12:31:09.664 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: #3 mView = null
05-17 12:31:09.694 23136-23136/mx.gob.lahuerta.oficiadepartes I/Timeline: Timeline: Activity_launch_request id:mx.gob.lahuerta.oficiadepartes time:9760189
05-17 12:31:09.724 23136-23136/mx.gob.lahuerta.oficiadepartes E/ViewRootImpl: sendUserActionEvent() mView == null
05-17 12:31:09.724 23136-23136/mx.gob.lahuerta.oficiadepartes D/SecWifiDisplayUtil: Metadata value : none
05-17 12:31:09.724 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: #1 mView = android.widget.LinearLayout{f951288 V.E...... ......I. 0,0-0,0 #10203a7 android:id/toast_layout_root}
05-17 12:31:09.774 23136-23136/mx.gob.lahuerta.oficiadepartes W/ResourcesManager: getTopLevelResources: /data/app/mx.gob.lahuerta.oficiadepartes-2/base.apk / 1.0 running in mx.gob.lahuerta.oficiadepartes rsrc of package null
05-17 12:31:09.774 23136-23136/mx.gob.lahuerta.oficiadepartes W/ResourcesManager: getTopLevelResources: /data/app/mx.gob.lahuerta.oficiadepartes-2/base.apk / 1.0 running in mx.gob.lahuerta.oficiadepartes rsrc of package null
05-17 12:31:10.044 23136-23136/mx.gob.lahuerta.oficiadepartes D/AbsListView: Get MotionRecognitionManager
05-17 12:31:10.044 23136-23136/mx.gob.lahuerta.oficiadepartes E/MotionRecognitionManager: mSContextService = [email protected]
05-17 12:31:10.044 23136-23136/mx.gob.lahuerta.oficiadepartes E/MotionRecognitionManager: motionService = [email protected]52bb373
05-17 12:31:10.044 23136-23136/mx.gob.lahuerta.oficiadepartes E/MotionRecognitionManager: motionService = [email protected]52bb373
05-17 12:31:10.064 23136-23136/mx.gob.lahuerta.oficiadepartes D/SecWifiDisplayUtil: Metadata value : none
05-17 12:31:10.074 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{98adc7 V.E...... R.....I. 0,0-0,0}
05-17 12:31:10.074 23136-23334/mx.gob.lahuerta.oficiadepartes I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
05-17 12:31:10.074 23136-23334/mx.gob.lahuerta.oficiadepartes I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
05-17 12:31:10.084 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{3685f63 I.E...... R.....ID 0,0-0,0}
05-17 12:31:10.084 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
05-17 12:31:10.084 23136-23136/mx.gob.lahuerta.oficiadepartes W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
05-17 12:31:10.214 23136-23136/mx.gob.lahuerta.oficiadepartes W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
05-17 12:31:10.234 23136-23136/mx.gob.lahuerta.oficiadepartes W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
05-17 12:31:10.244 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
05-17 12:31:10.244 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 72 - 0, 0) vi=Rect(0, 72 - 0, 0) or=1
05-17 12:31:10.294 23136-23136/mx.gob.lahuerta.oficiadepartes I/Timeline: Timeline: Activity_idle id: [email protected] time:9760784
05-17 12:31:10.524 23136-23136/mx.gob.lahuerta.oficiadepartes V/ActivityThread: updateVisibility : ActivityRecord{a1042f9 [email protected] {mx.gob.lahuerta.oficiadepartes/mx.gob.lahuerta.oficiadepartes.Login}} show : false
05-17 12:31:10.594 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: #3 mView = null
05-17 12:31:10.604 23136-23136/mx.gob.lahuerta.oficiadepartes E/ViewRootImpl: sendUserActionEvent() mView == null
05-17 12:31:11.714 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: #3 mView = null
05-17 12:31:11.944 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: ViewPostImeInputStage processPointer 0
05-17 12:31:11.984 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: ViewPostImeInputStage processPointer 1
05-17 12:31:12.664 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: ViewPostImeInputStage processPointer 0
05-17 12:31:12.724 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: ViewPostImeInputStage processPointer 1
05-17 12:31:13.754 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: ViewPostImeInputStage processPointer 0
05-17 12:31:13.814 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: ViewPostImeInputStage processPointer 1
05-17 12:31:13.874 23136-23136/mx.gob.lahuerta.oficiadepartes D/AbsListView: Get MotionRecognitionManager
05-17 12:31:13.894 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{216bc08 V.E...... R.....I. 0,0-0,0}
05-17 12:31:13.914 23136-23407/mx.gob.lahuerta.oficiadepartes I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
05-17 12:31:13.914 23136-23407/mx.gob.lahuerta.oficiadepartes I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
05-17 12:31:13.954 23136-23136/mx.gob.lahuerta.oficiadepartes W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
05-17 12:31:13.964 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
05-17 12:31:14.154 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: #3 mView = null
05-17 12:31:14.344 23136-23136/mx.gob.lahuerta.oficiadepartes E/ViewRootImpl: sendUserActionEvent() mView == null
05-17 12:31:15.254 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: ViewPostImeInputStage processPointer 0
05-17 12:31:15.314 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: ViewPostImeInputStage processPointer 1
05-17 12:31:15.384 23136-23136/mx.gob.lahuerta.oficiadepartes I/Timeline: Timeline: Activity_launch_request id:mx.gob.lahuerta.oficiadepartes time:9765872
05-17 12:31:15.444 23136-23136/mx.gob.lahuerta.oficiadepartes W/ResourcesManager: getTopLevelResources: /data/app/mx.gob.lahuerta.oficiadepartes-2/base.apk / 1.0 running in mx.gob.lahuerta.oficiadepartes rsrc of package null
05-17 12:31:15.534 23136-23136/mx.gob.lahuerta.oficiadepartes D/SecWifiDisplayUtil: Metadata value : none
05-17 12:31:15.534 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{5c368d1 I.E...... R.....ID 0,0-0,0}
05-17 12:31:15.614 23136-23136/mx.gob.lahuerta.oficiadepartes W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
05-17 12:31:15.614 23136-23136/mx.gob.lahuerta.oficiadepartes W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
05-17 12:31:15.644 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 72 - 0, 0) vi=Rect(0, 72 - 0, 0) or=1
05-17 12:31:15.714 23136-23186/mx.gob.lahuerta.oficiadepartes D/OpenGLRenderer: endAllActiveAnimators on 0x9ef18f00 (ListView) with handle 0x9f1b70d0
05-17 12:31:15.724 23136-23136/mx.gob.lahuerta.oficiadepartes I/Timeline: Timeline: Activity_idle id: [email protected] time:9766211
05-17 12:31:15.924 23136-23136/mx.gob.lahuerta.oficiadepartes V/ActivityThread: updateVisibility : ActivityRecord{c6b16d3 [email protected] {mx.gob.lahuerta.oficiadepartes/mx.gob.lahuerta.oficiadepartes.Drawer}} show : false
05-17 12:31:18.314 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: ViewPostImeInputStage processPointer 0
05-17 12:31:18.414 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: ViewPostImeInputStage processPointer 1
05-17 12:31:18.424 23136-23136/mx.gob.lahuerta.oficiadepartes D/AbsListView: Get MotionRecognitionManager
05-17 12:31:18.424 23136-23136/mx.gob.lahuerta.oficiadepartes E/MotionRecognitionManager: mSContextService = [email protected]
05-17 12:31:18.424 23136-23136/mx.gob.lahuerta.oficiadepartes E/MotionRecognitionManager: motionService = [email protected]fda3e1a
05-17 12:31:18.424 23136-23136/mx.gob.lahuerta.oficiadepartes E/MotionRecognitionManager: motionService = [email protected]fda3e1a
05-17 12:31:18.444 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{8cf9e79 V.E...... R.....I. 0,0-0,0}
05-17 12:31:18.504 23136-23136/mx.gob.lahuerta.oficiadepartes W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
05-17 12:31:18.524 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
05-17 12:31:20.014 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: ViewPostImeInputStage processPointer 0
05-17 12:31:20.074 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: ViewPostImeInputStage processPointer 1
05-17 12:31:20.194 23136-23136/mx.gob.lahuerta.oficiadepartes D/ViewRootImpl: #3 mView = null
05-17 12:31:20.204 23136-23136/mx.gob.lahuerta.oficiadepartes V/ActivityThread: updateVisibility : ActivityRecord{8ce61ca [email protected] {mx.gob.lahuerta.oficiadepartes/mx.gob.lahuerta.oficiadepartes.Modificar}} show : false
05-17 12:31:20.204 23136-23136/mx.gob.lahuerta.oficiadepartes E/ViewRootImpl: sendUserActionEvent() mView == null
05-17 12:31:33.634 23136-23136/mx.gob.lahuerta.oficiadepartes E/BitmapFactory: Unable to decode stream: java.io.FileNotFoundException: /storage/emulated/0/MyPictureApp/PictureApp/1495042280.jpg: open failed: EACCES (Permission denied)
05-17 12:31:33.694 23136-23136/mx.gob.lahuerta.oficiadepartes W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
05-17 12:31:33.704 23136-23136/mx.gob.lahuerta.oficiadepartes I/Timeline: Timeline: Activity_idle id: [email protected] time:9784197
05-17 12:31:33.804 23136-23148/mx.gob.lahuerta.oficiadepartes I/ExternalStorage: Scanned /storage/emulated/0/MyPictureApp/PictureApp/1495042280.jpg:
05-17 12:31:33.804 23136-23148/mx.gob.lahuerta.oficiadepartes I/ExternalStorage: -> Uri = content://media/external/images/media/2964
    
asked by Sharly Infinitywars 17.05.2017 в 17:07
source

1 answer

3

The error I see in your LogCat is:

  

Unable to decode stream: java.io.FileNotFoundException:   /storage/emulated/0/MyPictureApp/PictureApp/1495042280.jpg: open   failed: EACCES (Permission denied)

Apparently if the file exists but your application does not have read and write permission, remember that for Android 6.0 the permissions WRITE_EXTERNAL_STORAGE (which is implicitly also READ_EXTERNAL_STORAGE they are required manually and it is not enough to declare them in your AndroidManifest.xml :

You can request permission before trying to read the external storage, call this method:

private void checkExternalStoragePermission() {
    int permissionCheck = ContextCompat.checkSelfPermission(
            this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
    if (permissionCheck != PackageManager.PERMISSION_GRANTED) {
        Log.i("Mensaje", "No se tiene permiso para leer.");
            ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 225);
    } else {
        Log.i("Mensaje", "Se tiene permiso para leer!");
    }
}

You can validate calling the method only operating systems greater than or equal to Android 6.0:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){
    //Verifica permisos para Android 6.0+
     checkExternalStoragePermission();
}
  

The application gives me the option to select if I want to take the photo or   select one that is already stored. Well, when opting for the option of   select it from storage, it is shown in the imageView   but I can not show the name of the image in the EditText.

The problem here is that imageName only acquires value when the block is executed:

if(isDirectoryCreated){
...

I advise you to get the name of the image you can do it in onActivityResult() :

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if(resultCode == RESULT_OK){
        switch (requestCode){
            case PHOTO_CODE:
                ...
                imageName = mPath.substring(mPath.lastIndexOf("/")+1);
                nombreImagen.setText(imageName);
                ...
                break;
            case SELECT_PICTURE:
                ...
                ...
                imageName = path.getPath().substring(path.getPath().lastIndexOf("/")+1);
                nombreImagen.setText(imageName);
                break;
        }
    }
}
    
answered by 17.05.2017 / 20:01
source