/mnt/sdcard/new
から特定のフォルダを削除する必要があります。DDMSからフォルダを削除する
私はEclipseでDDMSのフォルダを見ています。
特定のフォルダを削除するにはどうすればよいですか。
ありがとうございます。
// Deletes all files and subdirectories under dir.
// Returns true if all deletions were successful.
// If a deletion fails, the method stops attempting to delete and returns false.
public static boolean deleteDir(File dir) {
if (dir.isDirectory()) {
String[] children = dir.list();
for (int i=0; i<children.length; i++) {
boolean success = deleteDir(new File(dir, children[i]));
if (!success) {
return false;
}
}
}
// The directory is now empty so delete it
return dir.delete();
}
書き込みコールdeleteDir()削除する-r
パラメータでrm
コマンドを使用することができます
// Delete an empty directory
boolean success = (new File("directorypath")).delete();
if (!success) {
// Deletion failed Message
}
いやが、問題は何であるのに役立ちます願って、あなたはDDMS内のフォルダを表示することができます??もしそうであれば、それをプログラムで選択して削除することができます。 –
この方法でファイルは削除できますが、フォルダは削除できません。@Arfin –
DDMSからはできません。あなたはadbシェル** adb shell rmdir/mnt/sdcard/Folder ** – user370305