更新时间:2022-05-09 10:59:30
看起来还没有人对此有一个答案,我已经解决了这个问题,并希望分享我的解决方法.因此,基本上,这是行不通的,因为我没有在运行时请求权限.
Look's like no one has an answer for this yet, I have already solved the issue and wanted to share how I solved it. So basically It wasn't working because I wasn't asking for permission on runtime.
我所做的是向运行时询问权限.在下面使用此代码.
What I did was ask the permission on runtime. Using this code below.
ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1);