这个程序很简洁,进入就是一片白。。。无其他东东,亮度为最大,是屏幕的手电(5320不支持闪光灯)
右软键和3键是退出,还有我右软键用165的键值不行,而用-7才行,有知道的请告诉这是什么情况。
import javax.microedition.midlet.MIDlet;import javax.microedition.midlet.MIDletStateChangeException;import javax.microedition.lcdui.*;import com.nokia.mid.ui.DeviceControl;public class a extends MIDlet { private Display display; MyCanvas mc = new MyCanvas(); public a() { } protected void startApp() throws MIDletStateChangeException { display = Display.getDisplay(this); display.setCurrent(mc); } protected void destroyApp(boolean arg0) throws MIDletStateChangeException { } protected void pauseApp() { } class MyCanvas extends Canvas { public void paint(Graphics g) { g.setColor(255, 255, 255); g.fillRect(0, 0, 320, 240); setFullScreenMode(true); DeviceControl.setLights(0, 100); } protected void keyPressed(int keyCode) { if (keyCode == 165 || keyCode == 51 || keyCode == -7) { try { destroyApp(true); } catch (MIDletStateChangeException e) { e.printStackTrace(); } notifyDestroyed(); } } }}