Android 检查文件是否存在()无效

Android check if file exists() not work

我正在检查设备文件夹中的数据库是否存在。文件夹和数据库存在,但未找到。路是对的,那我哪里错了?

private void checkDBexists() {
    File internal = Environment.getExternalStorageDirectory();
    File myFile = new File(internal.getAbsoluteFile() + "MyFolder/database.db");

    if (myFile.exists()) {
        importaDB();
    } else {
        Toast toast = Toast.makeText(getActivity().getApplicationContext(), "not work", Toast.LENGTH_SHORT);
        toast.show();
    }
}
 File myFile = new File(internal.getAbsoluteFile()+"/MyFolder/database.db");

MyFolder前添加“/”。