Java tutorial
//package com.java2s; import android.net.Uri; import java.io.File; public class Main { public static boolean deleteTempPic(Uri paramUri) { if (!isTempPic(paramUri)) return false; return new File(paramUri.getPath()).delete(); } public static boolean isTempPic(Uri paramUri) { return (paramUri != null) && (paramUri.getLastPathSegment() != null) && (paramUri.getLastPathSegment().startsWith("pic-")); } }