getDisplay() in Constructor or at startApp()
Page 1 of 1
getDisplay() in Constructor or at startApp()
is it better to identify the display in the constructor or in the method startApp().
Code:
Code:
somebody informed me, that some mobile phones are unable to execute "getDisplay" in the constructor. but most of the open source code i checked are coded in this way.
what's your style? do you know, if there can be any trouble?
Code:
- Code:
public class SampleMIDlet extends MIDlet {
private Display display;
protected void startApp() throws MIDletStateChangeException {
display = Display.getDisplay(this);
}
...
}
Code:
- Code:
public class SampleMIDlet extends MIDlet {
private Display display;
public SampleMIDlet() {
display = Display.getDisplay(this);
}
...
}
somebody informed me, that some mobile phones are unable to execute "getDisplay" in the constructor. but most of the open source code i checked are coded in this way.
what's your style? do you know, if there can be any trouble?
javafan- Posts : 11
Join date : 2007-09-11
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum