2013-09-28 1 views
-1
{ 

     File file = new File("DCIM\*");// here i am going to add the path so the folder.. 

     if(file.delete()){ 
      System.out.println(file.getName() + " is deleted!"); 
     }else{ 
      System.out.println("Delete operation is failed."); 

     } 

이렇게하면 폴더에있는 모든 이미지와 비디오가 삭제됩니다.안드로이드 DCIM 폴더의 경로는 무엇입니까? 안드로이드 카메라 갤러리 폴더 경로를 가져와 이미지와 비디오를 삭제 하시겠습니까?

+0

이 링크를 user2818864이-참조 @ 유를 -http하는 데 도움이 : //www.coderzheaven.com/2012/04/20/select-an-image-from-gallery-in-android-and-show-it를 -in-an-imageview/ – FarhaSameer786

+1

문자열 폴더 = "/ sdcard/DCIM"; – k0sh

+0

감사합니다 kosh 및 Farha .. – Ifrah

답변

4
Intent i = new Intent(
Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); 

startActivityForResult(i, RESULT_LOAD_IMAGE); 


or like this 

String directoryPath = Environment.getExternalStorageDirectory() + "/" + IMAGE_DIRECTORY + "/"; 
+0

고마워요 파라 .. 내가 위치를 설정했지만 이미지와 비디오가 삭제되지 않습니다 .. 뭐가 문제가 뭐죠? – Ifrah

+0

Sanket 내가 편집 한 코드를 시도했지만 이미지도 삭제하지 않았습니다. – Ifrah

관련 문제