On options menu Item click I want to show the files of emulator sd card in a list view.But Its not working for me.
my code is showing nothing on the options menu item click.
here is my code which I want to execute on options menu item click
Help is always appreciated.Thanks
private void initUI() {
ArrayList<String> files = new ArrayList<String>();
mFileList = (ListView) findViewById(R.id.fileList);
try {
object = (ArrayList<FileMetaData>) reviewer
.review("/mnt/sdcard/");
for (FileMetaData s : object) {
s.getName();
System.out.println(s.getName());
files.add(s.getName());
adapter = new ArrayAdapter<String>(this, R.layout.fileorfolder,
files);
mFileList.setAdapter(adapter);
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Try this:
You now have a String array of the files and subdirectories.