List of usage examples for android.os Environment getRootDirectory
public static File getRootDirectory()
From source file:com.codename1.impl.android.AndroidImplementation.java
/** * @inheritDoc/*from w ww . j ava 2 s . c o m*/ */ public String[] listFilesystemRoots() { if (!checkForPermission(Manifest.permission.READ_EXTERNAL_STORAGE, "This is required to browse the file system")) { return new String[] {}; } String[] storageDirs = getStorageDirectories(); if (storageDirs != null) { String[] roots = new String[storageDirs.length + 1]; System.arraycopy(storageDirs, 0, roots, 0, storageDirs.length); roots[roots.length - 1] = addFile(Environment.getRootDirectory().getAbsolutePath()); return roots; } return new String[] { addFile(Environment.getRootDirectory().getAbsolutePath()) }; }