Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

alert problem on T610

 
Matt Bilson
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,
just written some code to display a fairly simple alert. It works fine in the emulator - just how it should. Trouble is, when i bluetooth it over to my T610, it doesn't work right!
>>>>>>>
canvas = new BOCanvas(this, levelNum);
canvas.setCommandListener(this);
canvas.addCommand(forfeitKey);
displayMan.setCurrent( canvas );

nextLevel = new Alert(alertTitle, "Level " + levelNum, null, AlertType.INFO);
nextLevel.setTimeout(2000);
displayMan.setCurrent(nextLevel);
>>>>>>>
Basically the code is called when a "play game" call is made. It's purpose is to pop an alert saying the level number, then go into the game.
In the emulator this works perfectly.
However on my phone, when 'play game' is selected, the alert is called, but it seems that the :
displayMan.setCurrent( canvas );
piece of code isnt because after the alert, the menu with 'play game' upon it, re-appears. If I duplicate the setCurrent( canvas); piece of code and put it after setCurrent(nextLevel); then the canvas is displayed, but the alert isnt displayed (or probably it is displayed just for a split second)
If anyone could help me out I'd be very gratfeul!
Matt
 
Orika Akawana
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is strange. Such code should not show something after alert. And it should not work on emulator also. Last screen you set is alert and it should stay.
The solution is to use
setCurrent(Alert alert, Displayable nextDisplayable
method of Display class. Or simple duplicate your code (as you described).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic