Trying to check if a file exists in internal storage

前端 未结 3 2042
野的像风
野的像风 2020-12-13 18:14

The following code is how I am trying to identify if a file exists in the internal storage, MODE_PRIVATE.

public boolean isset(String filename){         


        
3条回答
  •  轮回少年
    2020-12-13 18:53

    hope this method helps you.

    public boolean fileExist(String fname){
        File file = getBaseContext().getFileStreamPath(fname);
        return file.exists();
    }
    

提交回复
热议问题