Writing MIDlet for SMS - V
11 April 2008In this post, I will present pauseApp and destroyApp methods. You are supposed to write these in your application. Do revise MIDlet life cycle for better understanding.
Pause signals the thread to stop by clearing the thread field. If stopped before done with the iterations it will be restarted from scratch later.
public void pauseApp() { done = true; thread = null; resumeScreen = display.getCurrent(); }
Destroy must cleanup everything. The thread is signaled to stop and no result is produced.
public void destroyApp(boolean unconditional) { done = true; thread = null; if (smsconn != null) { try { smsconn.close(); } catch (IOException e) { // Ignore any errors on shutdown } } }
Related Posts:
- Writing MIDlet for SMS - VI
- Writing MIDlet for SMS - IV
- Writing MIDlet for SMS - I
- Deploying MIDlets onto Mobile Devices (III)
- Writing MIDlet for SMS - II
- MIDlet Suite
- Writing MIDlet for SMS - III
- Creating J2ME MIDlet Project - I
- Record Management System (III)
- Converting an existing project to an EclipseME project
Top Of Page | Trackback
If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.
It will look like this: Writing MIDlet for SMS - V