-2
我想檢查位於我的原始文件夾下我的水庫的MP3文件。我的MP3文件存在,但我的代碼給了我一個虛假的回報。檢查一個文件,如果它存在或不存在(不工作)
String filename = "android.resource://" + this.getPackageName() + "/raw/w";
Toast.makeText(ViewPager.this, mp3check(filename)+"",Toast.LENGTH_LONG).show();
檢查MP3文件
public boolean mp3check(String _filename) {
return new File(_filename).exists();
}
我正在使用API 14,但是這行最終路徑destination = Paths.get(newFilePath);'所需的API 26。 –