MapMidlet.java
资源名称:GMapsTest.rar [点击查看]
上传用户:hygd004
上传日期:2022-07-01
资源大小:246k
文件大小:2k
源码类别:
J2ME
开发平台:
Java
- //Download by http://www.codefans.net
- import javax.microedition.lcdui.Display;
- import javax.microedition.lcdui.Displayable;
- import javax.microedition.midlet.*;
- /**
- * MIDlet.
- * The application must extend the MIDlet class to allow the application management software to control the MIDlet.
- */
- public class MapMidlet extends MIDlet{
- private MyGCanvas m_canvas;
- /**
- * The default constructor.
- */
- public MapMidlet()
- {
- //m_canvas=new MapMidlet(this);
- m_canvas = new MyGCanvas();
- }
- /**
- * Signals the MIDlet that it has entered the Active state
- * The method will only be called when the MIDlet is in the Paused state
- * Performs some initialization, places app in active state
- * @exception MIDletStateChangeException is thrown if the MIDlet cannot
- * start now but might be able to start at a later time.
- */
- protected void startApp()throws javax.microedition.midlet.MIDletStateChangeException
- {
- Displayable current = Display.getDisplay(this).getCurrent();
- m_canvas = new MyGCanvas();
- if (current == null)
- {
- Display.getDisplay(this).setCurrent(m_canvas);
- //m_canvas.start();
- }
- else
- {
- Display.getDisplay(this).setCurrent(m_canvas);
- }
- }
- /**
- * Signals the MIDlet to enter the Paused state.
- * In the Paused state the MIDlet must release shared resources.
- */
- protected void pauseApp()
- {
- }
- /**
- * Signals the MIDlet to terminate and enter the Destroyed state.
- * In the destroyed state the MIDlet must release all resources and
- * save any persistent state
- * @param unconditional If true when this method is called, the
- * MIDlet must cleanup and release all resources. If false the
- * MIDlet may throw MIDletStateChangeException to indicate
- * it does not want to be destroyed at this time.
- *
- */
- protected void destroyApp(boolean undefine)
- {
- }
- /**
- * the Method to terminate the MIDlet
- * and exit the application.
- */
- public void exitApp()
- {
- m_canvas = null;
- destroyApp(true);
- notifyDestroyed();
- }
- }