minimizing a mobile application on exit button press

故事扮演 提交于 2019-12-05 16:21:09

According to Nokia documentation at http://library.developer.nokia.com/index.jsp?topic=/Java_Developers_Library/GUID-C5D3E0F5-72B9-4EE7-8BA7-20DE4A538FB8.html you can add the following jad key: Nokia-MIDlet-No-Exit.

"Prevents the MIDlet from closing via pressing the End key. Instead of closing the MIDlet it is put to the background. The MIDlet can be still closed from the list of open applications."

Example:
Nokia-MIDlet-No-Exit: true

To minimize application use following line of code::

                  Display.getDisplay (MIDLET_CLASS_NAME).setCurrent (null);

to get the screen back use the following:

                  Display.getDisplay (MIDLET_CLASS_NAME).setCurrent (myCanvas);

Where myCanvas is your canvas instantiation

this does not work on all models. (Works on Nokia s60, SonyEricsson, but not on Nokia s40, Samsung and some others.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!