This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

destroy a midlet?

 
kumar mdu
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

How to destroy a midlet from a form not by extending midlet..?


I used code like this by Extending form



In midlet


Error i'm getting is

java.lang.NullPointerException
at com.testcommand.TheFormScreen.commandAction(+12)
at javax.microedition.lcdui.Display$DisplayAccessor.commandAction(+282)
at javax.microedition.lcdui.Display$DisplayManagerImpl.commandAction(+10)
at com.sun.midp.lcdui.DefaultEventHandler.commandEvent(+68)
at com.sun.midp.lcdui.AutomatedEventHandler.commandEvent(+47)
at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.handleVmEvent(+186)
at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.run(+57)


I know its simple but i'm not able to destroy the midlet

help me to solve this
kumar
 
kumar mdu
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no one
 
Darryl Burke
Bartender
Posts: 5126
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to pass a reference to the MIDlet to the Form's constructor, assign it to an instance field, and call exitMIDlet() on that reference.

Just declaring a MIDlet variable named mailMIDlet doesn't automagically assign the variable to the desired reference.
 
kumar mdu
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your reply

I tried what you said

In MIDlet



In form 'TheEditPosition' constructor


I got this error.

java.lang.NullPointerException
Generic/midp2: at de.enough.polish.sample.TheEditPosition.commandAction(+12)
Unable to translate stacktrace: Unable to start the "jad"-decompiler: [java.io.IOException: Cannot run program "jad.exe": CreateProcess error=2, The system cannot find the file specified]. jad is available from http://www.kpdus.com/jad.html.


what i made wrong?

help me to solve this
kumar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic