I am developing a simple app for blacberry with eclipse. I have just set up a ListField with a call back and then my app don't want to stop running after I close it. One very annoying consequence is that I have to reboot the simulator each time I want to test my app.
Thank you for your help :D !
public class MyMainScreen extends MainScreen {
private ListField lfMessage; // UI list of messages
// Constructor
public MyMainScreen() {
// set the title
setTitle("My App");
ListField lfMessage;
lfMessage = new ListField();
lfMessage.setEmptyString("Nothing to see here", DrawStyle.LEFT);
lfMessage.setSize(5);
lfMessage.setCallback(new MessageListCallBack());
add(lfMessage);
}
// Menu item "Close"
private MenuItem closeItem = new MenuItem("Close", 110, 10) {
public void run() {
lfMessage.setCallback(null);
lfMessage = null;
onClose();
}
};