华为手机头像上传裁剪操作 报错
澳门赌场开户
澳门赌场开户
当前位置 : 澳门赌场开户 > 在线博彩导航

华为手机头像上传裁剪操作 报错

  1. 华为手机头像上传操作, 裁剪点存储--进入裁剪后--点确定, 就直接报错退出程序了,其他机型测都是成功的,求大神指教

  2. 报错代码

@Override
    protected void onActivityResultint requestCode, int resultCode, Intent data {
        super.onActivityResultrequestCode, resultCode, data;
//        try {
//            tvNickName.setTextURLDecoder.decodeURLDecoder.decodegetConfig
//                    .getUserInfo.getUserName, "utf-8", "utf-8";
//        } catch UnsupportedEncodingException e {
//            e.printStackTrace;
//        }
        switch requestCode {
            case Constant.REQUEST_CAMERA_TAKE_PIC:
                // 拍照
                if RESULT_OK == resultCode {
                    startPhotoZoomphotoUri;
                }
                break;
            case Constant.REQUEST_SELECT_PIC_SINGLE:
                if RESULT_OK == resultCode {// 从相册选取
                    Uri uri = data.getData;
                    if uri != null {
                        // 大坑 4.4之后 相册选取图片返回Uri跟以前的不太一样了
                        //content://media/external/images/media/87540
                        String path = SystemUtils.getPaththis, data.getData;
                        Logger.dpath + "";
                        startPhotoZoomUri.fromFilenew Filepath;
                    }
                }
                break;
            case CUT_PHOTO_REQUEST_CODE:
                // 裁剪返回
                if resultCode == RESULT_OK && null != data {
                    //postHeadIcongetConfig.getUserInfo.getUserId, drr;
                    //String PicturePath = data.getStringExtraMediaStore.EXTRA_OUTPUT;

                    Logger.dmFileName +"裁剪返回的类型名" + mProtraitPath;
                    uploadNewPhotogetConfig.getUserName, mFileName, mProtraitPath;
                }
                break;
            default:
                break;
        }
    }

3.报错日志

  Caused by: java.lang.NullPointerException
                                                                  at java.io.File.fixSlashesFile.java:185
                                                                  at java.io.File.<init>File.java:134
                                                                  at com.ht.alphagu.activity.UserInfoActivity.copressImageUserInfoActivity.java:462
                                                                  at com.ht.alphagu.activity.UserInfoActivity.uploadNewPhotoUserInfoActivity.java:261
                                                                  at com.ht.alphagu.activity.UserInfoActivity.onActivityResultUserInfoActivity.java:247
                                                                  at android.app.Activity.dispatchActivityResultActivity.java:5554
                                                                  at android.app.ActivityThread.deliverResultsActivityThread.java:3548
                                                                  at android.app.ActivityThread.performResumeActivityActivityThread.java:2962 
                                                                  at android.app.ActivityThread.handleResumeActivityActivityThread.java:3004 
                                                                  at android.app.ActivityThread.handleLaunchActivityActivityThread.java:2318 
                                                                  at android.app.ActivityThread.access$1100ActivityThread.java:141 
                                                                  at android.app.ActivityThread$H.handleMessageActivityThread.java:1238 
                                                                  at android.os.Handler.dispatchMessageHandler.java:102 
                                                                  at android.os.Looper.loopLooper.java:136 
                                                                  at android.app.ActivityThread.mainActivityThread.java:5336 
                                                                  at java.lang.reflect.Method.invokeNativeNative Method 
                                                                  at java.lang.reflect.Method.invokeMethod.java:515 
                                                                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.runZygoteInit.java:873 
                                                                  at com.android.internal.os.ZygoteInit.mainZygoteInit.java:689 
                                                                  at dalvik.system.NativeStart.mainNative Method 

获取裁剪后图片的路径用绝对路径试试,如:
File folder = new FileEnvironment.getExternalStorageDirectory.getAbsolutePath + "/Pictures/YourFolder";

栏目列表

广告位

澳门赌场开户