Multiple consecutive alerts in Java ME
Posted
by Casebash
on Stack Overflow
See other posts from Stack Overflow
or by Casebash
Published on 2010-03-30T04:29:04Z
Indexed on
2010/03/30
4:33 UTC
Read the original article
Hit count: 319
According to the documentation, Display.setCurrent doesn't work if the current displayable is an alert. Does anyone know how to work around this so that we can go from one alert to another? I am using CLDC 1.0 and MIDP 2.0.
My attempt
The spec does allow us to edit an alert while it is on screen, but some Nokia phones don't handle it well at all. So I am now trying to go from the alert to a canvas, then back to the alert. Of course I don't want the user to interact with the previous canvas, so it seems that I am forced to create a new blank canvas. As a sidenote, this has the slight disadvantage of looking worse on phones which still have the previous screen when an alert is shown.
The bigger problem is how to transition from the blank canvas back to an alert once the canvas is loaded. Testing on the Motorola emulator revealed that showNotify is not called after returning from an alert to the previous screen. I guess I could create the next alert in the paint method, but this seems like a ugly hack.
© Stack Overflow or respective owner