小编max*_*256的帖子

VS Code intelephense 显示不正确的错误:未定义的方法“保存”

我在 VS Code 中使用 intelephense v1.8.2 扩展,并且正在开发一个 laravel 项目。当我让用户使用Auth::user();并拨打$user->save();电话时,不断显示不正确的错误Undefined method 'save'。有办法解决这个问题吗?

在此输入图像描述

php laravel visual-studio-code intelephense

2
推荐指数
1
解决办法
4404
查看次数

在 android 11 中从 uri 创建文件 - getPath() 不起作用

我想在 android 11 的 ActivityResultCallback 中从 uri 创建一个文件。我用它uri.getPath()来将传入的 uri 转换为文件。但是,它在 android 11 中不起作用。这是我的代码:

       private void launchGallery (){
            Intent intent = new Intent(Intent.ACTION_PICK,
                    android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
            launcherGallery.launch(intent);
        }
    
        ActivityResultLauncher<Intent> launcherGallery = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(),
                result -> {
                    if (result.getResultCode() == RESULT_OK) {
                        Intent data = result.getData();
                        if (data != null) {
                            Uri imageUri = data.getData();
                            // ---> getPath() won't work in android 11 <---
                            File file = new File(imageUri.getPath());
                            // I don't want to display the image in an ImageView. 
                            // I …
Run Code Online (Sandbox Code Playgroud)

android uri file android-11 registerforactivityresult

1
推荐指数
1
解决办法
5393
查看次数