2

Estoy desarrollando un aplicación en donde implemento una opción para capturar una foto con la cámara y subirla a mi servidor.

Pues les comento lo siguiente, la aplicación funcionaba muy bien, podía tomar la foto y subirla a mi servidor, pero me doy cuenta que ya no me muestra la imagen capturada en mi ImageView, por lo cual no la puedo subir a mi servidor, y lo raro es que no le movi a nada!

Nota: Antes de que esto pasara tenía que tomar la fotografía con una resolución de menos de 4000, para que se pudiera visualizar en mi ImageView, pero ahora no importa la resolución, de cualquier modo no se visualiza.

Les dejo mi código:

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;
        }
    }
}

Este el el LogCat que recibo:

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/data@[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/data@[email protected]@[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/data@[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/data@[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/data@[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/data@[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/data@[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/data@[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/data@[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/data@[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/data@[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: android.os.BinderProxy@cc88c44 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 = android.hardware.scontext.ISContextService$Stub$Proxy@c8b03e2
05-17 12:31:10.044 23136-23136/mx.gob.lahuerta.oficiadepartes E/MotionRecognitionManager: motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy@52bb373
05-17 12:31:10.044 23136-23136/mx.gob.lahuerta.oficiadepartes E/MotionRecognitionManager: motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy@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: android.os.BinderProxy@cc02992 time:9760784
05-17 12:31:10.524 23136-23136/mx.gob.lahuerta.oficiadepartes V/ActivityThread: updateVisibility : ActivityRecord{a1042f9 token=android.os.BinderProxy@cc88c44 {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: android.os.BinderProxy@d0dbf8 time:9766211
05-17 12:31:15.924 23136-23136/mx.gob.lahuerta.oficiadepartes V/ActivityThread: updateVisibility : ActivityRecord{c6b16d3 token=android.os.BinderProxy@cc02992 {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 = android.hardware.scontext.ISContextService$Stub$Proxy@15e04c5
05-17 12:31:18.424 23136-23136/mx.gob.lahuerta.oficiadepartes E/MotionRecognitionManager: motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy@fda3e1a
05-17 12:31:18.424 23136-23136/mx.gob.lahuerta.oficiadepartes E/MotionRecognitionManager: motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy@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 token=android.os.BinderProxy@d0dbf8 {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: android.os.BinderProxy@d0dbf8 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
8
  • Te da algún error ?
    – FederHico
    el 17 may. 2017 a las 15:30
  • Haz probado con otro dispositivo para ver si te sucede lo mismo?? el 17 may. 2017 a las 15:46
  • Bitmap bitmap = BitmapFactory.decodeFile(mPath); en este punto se obtiene un valor null? agrega lo que muestra tu LogCat de otra forma es estar comentando a ciegas.
    – Jorgesys
    el 17 may. 2017 a las 15:55
  • ¿Tienes los permisos de almacenamiento en el manifiesto?
    – Saantty
    el 17 may. 2017 a las 16:19
  • @Jorgesys anexe el LogCat, si puedes checarlo, gracias por tu atencion, el 17 may. 2017 a las 17:34

1 respuesta 1

2

El error que veo en tu LogCat es:

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

Al parecer si existe el archivo pero no tiene permisos de lectura y escritura tu aplicación, recuerda que para Android 6.0 los permisos WRITE_EXTERNAL_STORAGE (que implicitamente es tambien READ_EXTERNAL_STORAGE se requieren manualmente y no es suficiente declararlos en tu AndroidManifest.xml :

puedes requerir el permiso antes de tratar de leer el almacenamiento externo, llama este método:

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!");
    }
}

Puedes validar llamar el metodo unicamente el sistemas operativos mayores o igual a Android 6.0 :

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

La aplicacion me da opcion de seleccionar si quiero tomar la foto ó seleccionar una que ya esta almacenada. Pues al optar por la opcion de seleccionarla del almacenamiento, esta si se muestra en el imageView pero no puedo mostrar el nombre de la imagen en el EditText.

El problema aquí es que imageName únicamente adquiere valor cuando se ejecuta el bloque:

if(isDirectoryCreated){
...

te aconsejo obtener el nombre de la imagen puedes realizarlo en 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;
        }
    }
}
5
  • funciono.. gracias! el 17 may. 2017 a las 18:28
  • Tambien tengo otro problemita... la aplicacion me da opcion de seleccionar si quiero tomar la foto ó seleccionar una que ya esta almacenada. Pues al optar por la opcion de seleccionarla del almacenamiento, esta si se muestra en el imageView pero no puedo mostrar el nombre de la imagen en el EditText el 17 may. 2017 a las 18:31
  • ya veo, es un problema al obtener el nombre en un bloque incorrecto de código. Agrego mi sugerencia de como obtener el nombre para que sea agregado a tu TextView.
    – Jorgesys
    el 17 may. 2017 a las 19:04
  • Perfecto! Gracias el 18 may. 2017 a las 0:21
  • 1
    hola @Jorgesys oye tengo un problema al tratar de subir la imagen tomandola desde la galeria.. me podrias ayudar?... Te etiquete en otra pregunta que formule con ese problema, es.stackoverflow.com/questions/70941/… el 18 may. 2017 a las 17:05

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.