// Populate _picDirectoryURLs with a list of directories
// that store pictures.
initPictureDirectories();
add(new RichTextField(
"Click on a pictures directory to display a list of the pictures it contains.\n",
Field.NON_FOCUSABLE));
final DemoVerticalFieldManager vfm =
new DemoVerticalFieldManager(Manager.NO_VERTICAL_SCROLL);
add(vfm);
_list = new SimpleList(vfm);
for (int i = 0; i < _pictureDirectoryURLs.size(); i++) {
_list.add((String) _pictureDirectoryURLs.elementAt(i));
}
// Set the list to display when a list item is activated
_list.setCommand(new Command(new CommandHandler() {
/**
* @see CommandHandler#execute(ReadOnlyCommandMetadata, Object)
*/
public void execute(final ReadOnlyCommandMetadata metadata,
final Object context) {
displayDirectoryPictures(_list.get(_list.getFocusRow()));
}
}));
if (DeviceInfo.hasCamera()) {
add(new RichTextField("\n...or invoke the camera application",
Field.NON_FOCUSABLE));
_invokeButtonField =
new ButtonField("Invoke Camera App",
ButtonField.CONSUME_CLICK | Field.FIELD_HCENTER) {
/**