private void getDir(string dirPath)
{
myPath.setText("Location: " + dirPath);
item = new ArrayList();
path = new ArrayList();
File f = new File(dirPath);
File[] files = f.listFiles();
//if (!(root.StringEquals(dirPath)))
//if (root != dirPath)
{
item.add(root);
path.add(root);
item.add("../");
path.add(f.getParent());
}
if (files != null)
for (int i = 0; i < files.Length; i++)
{
File file = files[i];
if (!file.isHidden() && file.canRead())
{
path.add(file.getPath());
if (file.isDirectory())
{
item.add(file.getName() + "/");
}
else
{
item.add(file.getName());
}
}
}
var fileList =
new ArrayAdapter(this, R.layout.row, item);
//new ArrayAdapter<String>(this, R.layout.row, item);
setListAdapter(fileList);
}