_pictureDirectoryURL = pictureDirectoryURL;
_pictureFileNames = pictureFileNames;
setTitle("Secondary Screen");
add(new LabelField("Select an image:", Field.FIELD_HCENTER));
final DemoVerticalFieldManager vfm =
new DemoVerticalFieldManager(Manager.NO_VERTICAL_SCROLL);
// Create a SimpleList to display the available image names
_picturesList = new SimpleList(vfm);
for (int i = 0; i < _pictureFileNames.size(); i++) {
_picturesList.add((String) _pictureFileNames.elementAt(i));
}
_picturesList.setCommand(new Command(new CommandHandler() {
/**
* @see CommandHandler#execute(ReadOnlyCommandMetadata, Object)
*/
public void execute(final ReadOnlyCommandMetadata metadata,
final Object context) {
setImage();
}
}));
add(vfm);
final SeparatorField separator = new SeparatorField();
separator.setPadding(50, 0, 0, 0);
add(separator);
add(new LabelField("Add shortcut to the home screen",
Field.FIELD_HCENTER));
add(new SeparatorField());
_homeScreenLocationPicker = HomeScreenLocationPicker.create();
add(_homeScreenLocationPicker);