Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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 ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

alert problem on T610

Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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);
displayMan.setCurrent( canvas );

nextLevel = new Alert(alertTitle, "Level " + levelNum, null, AlertType.INFO);
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!
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).
    Bookmark Topic Watch Topic
  • New Topic