Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.
Snapshot is taken before security dialog is displayed in S60 MIDlet (Known Issue)
In S60 Editions, because taking the snapshot would be delayed if such a security dialog were displayed before the snapshot is really taken, the S60 implementation takes the picture first and also plays the shutter sound before the confirmation is asked from the user.
According to the MIDP security domain policy recommendation, access to certain APIs is restricted for unsigned MIDlets (as well as MIDlets signed to trusted 3rd party domain). This applies also to multimedia recording APIs including taking a snapshot. For unsigned MIDlets, by default, a confirmation is asked every time these APIs are accessed. For trusted 3rd-party MIDlets the default is to ask once per session.
If the user does not allow the snapshot to be taken (answers "no" to the confirmation dialog), the SecurityException is correctly thrown.
In S60 5th Edition, the delay for the security prompt to appear can be up to 10+ seconds after the image has been taken. In addition, in some cases image capturing does not succeed until the MIDlet is closed and restarted and the capture is attempted again.
How to reproduce
This issue can be tested by using this code snippet:
Taking a picture in Java ME
Currently no workaround exists.