How to create file directories and folders in Android data/data/project filesystem

前端 未结 4 1277
粉色の甜心
粉色の甜心 2021-02-02 16:12

I am working on a video editor program and am fairly new to android and java. What I would like to happen is when the user presses \"create new project\" button, a dialog pops u

4条回答
  •  南方客
    南方客 (楼主)
    2021-02-02 16:51

    The proper way to get a directory that, for the primary device owner, resides under Android/data/packagename on external storage, is just to call getExternalFilesDir() on an available Context.

    That is,

    File folder = context.getExternalFilesDir("YOUR FOLDER NAME");
    

    And also you have to add write permission in Manifest

    
    

提交回复
热议问题