MMAPI: Moto Q8 emulator fails [message #570651] |
Tue, 13 January 2009 20:46 |
Eclipse User |
|
|
|
Originally posted by: news.s237965939.online.de
I'm working on a program which makes use of Midi playback. Now I
encountered an odd problem. Just by random i picked up the Moto Q8
emulator. My program successfuly runs on all other emulators I've tried.
So I tracked te problem down to the simplest possible example to show
the problem. The crash happens in the constructor of the canvas class.
Since it works on all other emulators I've checked, I ask myself what's
wrong with my code or what's wrong with the Moto Q8? I'm really clueless
here.
TIA,
Hans
================ TestQ8MIDlet.java, TOP OF FILE =================
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
public class TestQ8MIDlet extends MIDlet {
canvasQ8 cv;
public TestQ8MIDlet() {
cv = new canvasQ8();
}
protected void destroyApp(boolean arg0) throws
MIDletStateChangeException { }
protected void pauseApp() { }
protected void startApp() throws MIDletStateChangeException { }
}
=================== TestQ8MIDlet.java, BOTTOM OF FILE ===============
=================== canvasQ8.java, TOP OF FILE =================
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Graphics;
import javax.microedition.media.Player;
import javax.microedition.media.PlayerListener;
public class canvasQ8 extends Canvas {
public class EventHandler implements PlayerListener {
public void playerUpdate(Player player, String event, Object
eventData) {
if (event == PlayerListener.END_OF_MEDIA) {
player.deallocate();
}
}
}
EventHandler myEventHandler;
public canvasQ8() {
// this line causes te crash
myEventHandler = new EventHandler();
}
protected void paint(Graphics arg0) { }
}
=================== canvasQ8.java, BOTTOM OF FILE =================
|
|
|
Powered by
FUDForum. Page generated in 0.02666 seconds