• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

alert problem on T610

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic