How to access /storage/emulated/0/

前端 未结 16 2266
被撕碎了的回忆
被撕碎了的回忆 2020-12-13 01:53

I have written a code to record audio and save it to below file location.

private String getFilename() {
    String          


        
16条回答
  •  粉色の甜心
    2020-12-13 02:58

    Try This

    private String getFilename() {
        String filepath = Environment.getExternalStorageDirectory().getPath();
        File file = new File(filepath + "/AudioRecorder" );
        if (!file.exists()) {
            file.mkdirs();
        }
        return (file.getAbsolutePath() + "/" + System.currentTimeMillis() + ".mp4");
    }
    

提交回复
热议问题