Ahoj potřebuji spolehlivé řešení jak získat počet procent baterie ( 0 - 100% ) mělo by to fungovat všude nebo alespoň na Nokie a Sonny Eriksónu dík
Mám tento kód
value=Integer.parseInt(System.getProperty("com.nokia.mid.batterylevel"));
showFont(g, "-"+value, x+getWidth()-aFont.stringWidth(time)-5-20, y-heifon, aFonb);
ovšem píše to
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(+13)
at java.lang.Integer.parseInt(+6)
at Splash.paint(+219)
at javax.microedition.lcdui.Canvas.callPaint(+80)
at javax.microedition.lcdui.Display.repaint(+77)
at javax.microedition.lcdui.Display.registerNewCurrent(+237)
at javax.microedition.lcdui.Display.access$400(+6)
at javax.microedition.lcdui.Display$DisplayAccessor.foregroundNotify(+46)
at javax.microedition.lcdui.Display$DisplayManagerImpl.notifyWantsForeground(+152)
at javax.microedition.lcdui.Display$DisplayManagerImpl.access$100(+6)
at javax.microedition.lcdui.Display.setCurrentImpl(+115)
at javax.microedition.lcdui.Display.setCurrent(+29)
at android.startApp(+31)
at javax.microedition.midlet.MIDletProxy.startApp(+7)
at com.sun.midp.midlet.Scheduler.schedule(+270)
at com.sun.midp.main.Main.runLocalClass(+28)
at com.sun.midp.main.Main.main(+116)