How to make a J2ME application run in Background?

后端 未结 2 1801
情话喂你
情话喂你 2021-02-06 04:37

I have a written a J2ME application which uses Bluetooth and search a file within the peer mobile and download it. I would like to make my application run in background , whenev

2条回答
  •  孤街浪徒
    2021-02-06 05:20

    to set a j2me app to the background use the following in your midlet class:

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

    to get the screen back use the following:

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

    Where myCanvas is your canvas instantiation

    R

    p.s. You can still use a thread or timer to do things in the background while your midlet is hidden.

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

提交回复
热议问题