Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6979359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:52:36+00:00 2026-05-27T17:52:36+00:00

MIdlet’s class javadoc states that MIdlet.destroyApp() will be called if MIdlet.startApp() throws a RuntimeException

  • 0

MIdlet’s class javadoc states that MIdlet.destroyApp() will be called if MIdlet.startApp() throws a RuntimeException. Assuming no exception is thrown while executing MIDlet.startApp().

Is MIDlet.startApp() guaranteed to be executed fully before MIDlet.pauseApp() or MIDlet.destroyApp() is called ?

Example:

MIdlet’s class implementation:

startApp()
{
  System.out.println("A");
  System.out.println("B");
}

pauseApp()
{
  System.out.println("C");
  System.out.println("D");
}

destroyApp()
{
  System.out.println("E");
  System.out.println("F");
}

Output:

A
E
F

Output (alternative):

A
C
D

Are the outputs above possible scenarii ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:52:37+00:00Added an answer on May 27, 2026 at 5:52 pm

    MIDP javadoc answers it

    “If a Runtime exception occurs during startApp() the MIDlet will be destroyed IMMEDIATELY. Its destroyApp() will be called allowing the MIDlet to cleanup.”

    and the similarly for pauseApp() and destroyApp().

    So answer the OP it is NOT guaranteed to execute the method atomically. A runtime exception can/will change the state of the MIDlet and in effect the execution flow.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my MIDLet I have an instance of the java class ImageFetcher called anImg.
Is it safe to implement a MIDlet class as a singleton? That is, after
I have a MIDlet that sends TCP messages over the network to a server
I've written a MIDlet that does several advanced things: fetching images from the web,
I'm dealing with a midlet in j2me, and I have this thread class (say
I'm using Sun WTK to run a midlet that needs to send and optionally
I have built a LWUIT UI class which contains the Midlet. I am basically
I have a little problem. I have developed a midlet application that call some
can i write a MIDlet that stays resident like an agenda, that alarms when
I have a signed midlet (VeriSign Class 3), which runs perfectly in several Nokia

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.