MIDLet.destroyApp() and turning back to applications screen
Hi all,
When I choose exit in the code develivered with the Wireless Toolkit the screen returns to a screen filled with available MIDlets. When I choose exit in my application, the screen stays like it was in my MIDlet. How come?
Some code to clarify. First the Canvas class
public void keyPressed(int keyNumber) {
if ((keyNumber == KEY_POUND) || (keyNumber == KEY_STAR)) {
// User wants to quit.
myGame.closeConnection();
}As you see, a method in myGame is called. MyGame implements Runnable. It communicates using Bluetooth with another MIDlet:
public void closeConnection () {
try {
ins.close();
dins.close();
outs.close();
douts.close();
connection.close();
catch (IOException ioException) {
displayMessage("IO Error", "Unable to close " +
"the connection (IOException: " +
ioException.getMessage() + ")");
finally {
synchronized(this) {
isGameCompleted = true;
notifyAll ();
myMIDlet.destroyApp(true);
}And again, another class is called. This class, MyMIDlet contains the following destroyApp method:
public void destroyApp(boolean unconditional) {
}When I look at the example code (%WTK24%\apps\Demos\src\example\manyballs) delivered with the Wireless Toolkit is see the following code (first ManyBalls):
public void destroyApp(boolean unconditional)
throws MIDletStateChangeException {
canvas.destroy();
}The following code is called in the object ManyCanvas. It deletes all created balls:
void destroy() {
// kill all the balls and terminate
for (int i = 0; i < balls.length && balls[i] != null; i++) {
balls.stop = true;
// enable the balls to be garbage collected
balls[i] = null;
numBalls = 0;
So, how does it go back to the screen containing all the available MIDlets?
Maik
Try resetting the iPhone. Hold the Home and Sleep buttons until the Apple logo appears.
Similar Messages
-
Since I've upgraded my iphone 4 to ios 4.3.3, I can't access my inbox of hotmail.While it's checking e-mails,email application is closed and turn back to home screen.I've restored my phone but nothing changed.It still goes on.What should I do?
Thanks for reply,
It's truely a disestar for me to kill my phone myself by so called bloody upgradation.
Iwish I have not upgraded.
I baught it from here in Bangladesh and now I’m ina mess to get at least a minimum support.
Thanks for your valued suggessions but it didn’tmade any difference to my situation.
So now I have an ipod in the price of an iPhone4. Crap.
Is there any chance of fixing this bug by apple?As the same problem has already been faced by a lot of iPhone Users. -
I have iPad air, screen freezes after FaceTime call and cannot get back to home screen, have to power down and turn back on to get back to home screen. What am I doing wrong?
Hi RWD2,
Welcome to the Support Communities!
To resolve your issue with Facetime freezing when you end a call, I would try the first three steps in the article below.
iOS: Not responding or does not turn on
http://support.apple.com/kb/ts3281
Resolution
If a single application is not responding or stops responding when it opens, you can force it to close.
If the device is unresponsive or if certain controls aren't working as expected, restart your device.
If the device remains unresponsive or does not turn on (or power on), reset your device.
If you are using Wi-Fi, it may be helpful to try these troubleshooting steps as well:
iOS: Troubleshooting Wi-Fi networks and connections
http://support.apple.com/kb/TS1398?viewlocale=en_US
Reset network settings by tapping Settings > General > Reset > Reset Network Settings.
Note: This will reset all network settings including previously connected Wi-Fi networks and passwords
iOS and OS X: Recommended settings for Wi-Fi routers and access points
http://support.apple.com/kb/HT4199
I hope this information helps ....
Have a great day!
- Judy -
When im trying to edit a screen shot, my ipod crashes and turns back on. help!
so i was trying to edit a screen shot from instagram, and my ipod decides to randomly shut off and turn back on. it happens on about every 5th photo and is extremly annoying. help!
That is a bug in iOS 5.1.1, Restoring the iPod might prevent those crashes
-
Why does my 1st gen iPad always turns itself off and goes back to the screen. Whether I'm reading news, iBooks, etc, suddenly it goes off.
If that doesn't help, the battery may be dying and need replacement. See here (tap on Battery Replacement): http://support.apple.com/kb/index?page=servicefaq&geo=United_States&product=ipad
Alternately, might consider start saving for a new iPad. The newest iPad 6 should come out in the next few months. When it does, sellers will want to get rid of old inventory with good deals. -
Whenever I close my laptop then open it it does not turn back on, the screen stays off but I will hear the fan running. I then have to physically press the power button for it to turn on. Help!
Try here. iPhone and iPod touch: Frozen and unresponsive
-
my iphone wont turn on but when i plug it in to charge the apple logo comes on and turns back off after a few seconds i dont know what to do i need help
Hello warhogs17,
After reviewing your post, it sounds like the iPhone will not turn on past the Apple logo. I would recommend that you read this article, it may be able to help the issue.
If your iPhone, iPad, or iPod touch doesn't respond or doesn't turn on - Apple Support
Thanks for using Apple Support Communities.
Have a nice day,
Mario -
Unable to sync contacts, keep saying 'ipad already using contacts'. When I open contacts app it opens for fraction of secs and goes back to main screen. any ideas?
Sorry for double post, doesnt seem to be an edit option, this also works both ways.
-
my iphone I fell to the ground yesterday, from a height of approximately 1 meter. after this I trailed off, now only turns on when I plug the usb but the apple appears and just turn off and turn back, there is nothing more that I recommend doing?
With that behavior you need to take the iPhone to an Apple store genius bar for an out-of-warranty replacement. In the US that is $269 for the iPhone 5.
-
I can no longer type messages. I have tried deleting to see if I have too many saves messages. That did not help. I also cut off the phone and turned back on. That did not help. Ideas?
http://www.bubblews.com/news/874646-apple-is-having-issues
-
HT4623 os6 iphone 4s wifi password does not save when phone is turned off and turned back on
i just udpated my iphone 4S to OS6 and when accessing my secured wifi I add my password and then joins secured network. However, if I turn the phone off and turn back on again the wifi connection is lost and cannot re join until I add my password AGAIN. Tried soft reset and reset network but nothing worked.
Any other suggestions?If you do a search of the forums, there appear to be a number of postings regarding iOS6, wi-fi security and random disconnection of wi-fi. It appears, as the posts have discussed, it is connected to the use of WPA2 security. Most of the posting, however, have been related to iPhone 5, not the 4S. As far was what was posted, they say Apple has been made aware of the issue and they are looking for a fix. Not sure if that would help the iPhone 4S, because it does not support both bands as the iPhone 5 does. Just remember that WEP is less secure than WPA2. You might also try restarting your router after changing back to WPA2 on the phone, depending on what the router is set for.
-
My ipad is stuck on Apple ID Security and won't let me go anywhere else. It is frozen on this. Tried to shut it off and turn back on, but it still come up with this window.
I was updating the ios 7 and it ask for my icloud information. I just now started it up and it let me do the changes. Thanks.
-
My wifi was disconnected and turned back on. Now my phone either won't connect to the wifi or connects but doesn't work
Reset network settings.
Settings > General > Reset > Reset Network settings.
Then re-connect to WifI by setting it up again. -
Why My iPhone 4s close most of my apps when i opened them immediately and return back to home screen ?
What is the problem and how can i fix it ?Download a free app and see if that helps, you can delete the app later if you do not want it.
-
Why my mac pro dont start stay download and turn back off
My mac pro dont start stay download and turn back off
Thisvis not MacBook territory but.... same applies - bootable backup clone of your system and iot should never crash or freeze but if it does then consider using Recovery Mode immediately and Safe Boot Mode.
Your drive and its directory cannot be repaired without doing more.
Maybe you are looking for
-
IPod communication error when i updated iTunes!
I updated my itunes and now when i connect my iPod Nano to my computer this error message appears: The software for communicating with the iPod is not installed correctly. Please reinstall iTunes to intall the iPod's software. When I reinstall iTunes
-
Hello, i am trying to display an image.gif in a JTable using cellrenderer but i always get an error message. Everybodys help its always accepted. I did paste just a few parts of the code since its very long. In the cellrenderer class i have scored ou
-
Displayport stopped after using VGA
Hello everyone, I have put a VGA monitor on my VGA port of the T520 (built in Intel graphics). This went fine. Back at home I wanted to connect my Displayport monitor again, but this fails. It seems like my T520 does not want release the VGA monit
-
Hello, I have a requirement where I am displaying the ALV using grid. Have a button on top. After ALV display, I select the row and press the button. The processing takes place like (Delivery creation). After this delivery creation, I have to display
-
Sun One Web Server 6.1 with MS Active Directory??
I know this type of question has been posted a few times, but I couldnt locate any clear answer. Can we have Sun One WS 6.1 use MS Active Dir as its source of users and groups? I am trying to configure this using the standard base DN and bind DN para