Android examples for java.io:Directory
get Parent Dir for a path
import android.util.Log; import java.io.File; import java.text.DecimalFormat; import java.text.NumberFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main{ public static String getParentDir(String path) { File file = new File(path); return file.getParentFile().getName(); }/* w ww . ja v a2s . c om*/ }