Trying to check if a file exists in internal storage

前端 未结 3 2027
野的像风
野的像风 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:48

    Kotlin: This works for me !!

    fun check(path: String?): Boolean
    {
        val file = File(path)
        return file.exists()
    }
    

提交回复
热议问题