The Artima Developer Community
Sponsored Link

Java Buzz Forum
pauseApp Bug-J2ME Solutions

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Fred Grott

Posts: 4361
Nickname: shareme
Registered: Jan, 2003

Fred Grott is Lead Developer-CEO of ShareMe Technologies LLC -The Mobile Future
pauseApp Bug-J2ME Solutions Posted: Aug 11, 2003 5:26 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Fred Grott.
Original Post: pauseApp Bug-J2ME Solutions
Feed Title: ShareMe Technologies-The Mobile Future
Feed URL: http://sedoparking.com/search/registrar.php?domain=®istrar=sedopark
Feed Description: A Weblog about Java programming and digital convergence on mobile devices in such areas as P2P and collaborative technology. Old Archive .
Latest Java Buzz Posts
Latest Java Buzz Posts by Fred Grott
Latest Posts From ShareMe Technologies-The Mobile Future

Advertisement
Bug Background is such that an incoming sms or phone call will never fire off a call to pauseApp after the end user has pushed the answer call softkey whiel an app is using a screen implementing canvas. While calling Displayable.isShown() might seem logical in the paint frame drawing loop its wrought with ineffectiveness.

Use something like this instead:

protected void keyPressed(int keyCode) {

if(keyCode != LEFT || keyCode != RIGHT) {
gamePaiused=true;
menu.init(parent);
parent.setDisplayable(menu);
}
}

What you are doing is checking to see if game keys are pressed, if so then game is not paused. If other keys than game keys are pressed it is assumed that game is paused. Thus game gets paused for any non game key including the softkey for the pick up call button. Code is completely portable amoung all handsets.

The reason why it catches the softkey pressed all the time no matter where the midlet is in the process of looping through your canvas class is because you are caputring an event unlike the call to Displyable.isShown(). Pressing a softkey in any Midlet in any canvas screen will always fire off an event.

Side Note: On Forms because there is no thread or state to save and thus its okay for the answer call key press not to call pausedApp midlet method. When call is finished user is just seeing the From screen again and thus no harm, I hope.

Read: pauseApp Bug-J2ME Solutions

Topic: UI Tweaks-MoonBuzz-J2ME Previous Topic   Next Topic Topic: Mophun Sucks

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use