mengfanrong
        public static final String TEMP_PHOTO_FILE_NAME = "temp_photo.jpg";
	private static String mSdRootPath = Environment.getExternalStorageDirectory().getPath();  
	  /** 
	     * 删除SD卡或者手机的缓存图片和文件夹 
	     */  
	    public void deleteFile() {  
	    	Log.i("INFO", mSdRootPath+"/"+TEMP_PHOTO_FILE_NAME+"========================");
	        File dirFile = new File(mSdRootPath+"/"+TEMP_PHOTO_FILE_NAME);  
	       if(! dirFile.exists()){  
	           return;  
	        }  
	        if (dirFile.isDirectory()) {  
	            String[] children = dirFile.list();  
	            for (int i = 0; i < children.length; i++) {  
	                new File(dirFile, children[i]).delete();  
	            }  
	        }  
	         
	        dirFile.delete();  
	   }  



版权声明:本文博客原创文章。博客,未经同意,不得转载。

分类:

技术点:

相关文章:

  • 2022-01-08
  • 2021-11-04
  • 2022-12-23
  • 2021-10-16
  • 2021-08-26
  • 2021-11-16
猜你喜欢
  • 2021-12-12
  • 2021-12-22
  • 2021-12-11
  • 2022-12-23
  • 2021-11-26
相关资源
相似解决方案