Hi,
The following code causes a null pointer exception when running on my Nokia N8, but other platforms work fine:
// Take photo checkbox
findTakePhotoWaterCheckBox().addActionListener(new ActionListener() {
String filePath = "";
// When checkbox is clicked
@Override
public void actionPerformed(ActionEvent evt) {
if (findTakePhotoWaterCheckBox().isSelected()) {
// Capture photo at resolution ? x 768 (preserving sensor aspect ratio)
filePath = Capture.capturePhoto(1024, -1);
// Photo captured
if (filePath != null) {
Dialog.show("Camera", "Photo successfully captured: " + filePath, "Okay", null);
// Photo not captured
} else {
// PROBLEM CAUSED BY THIS LINE
findTakePhotoWaterCheckBox().setSelected(false);
}
}
}
});
I have a good feeling it's because when I cancel the camera without taking a photo the code tries to set the CheckBox selected to false.
Is there any work around for this?
Thanks