我使用LWUIT編寫了一個j2me應用程序。它可以在模擬器以及Symbian設備上正常工作。但是當我試圖在諾基亞s40設備上運行它時,它顯示出「無法顯示」消息。我試圖按照某些論壇的規定顯示啓動畫面。儘管如此,該應用程序永遠不會超過啓動畫面。諾基亞S40上的「Nothing to display」
EDIT 1
Display.init(this);
Resources r = Resources.open("/theme.res");
UIManager.getInstance().setThemeProps(r.getTheme(r.getThemeResourceNames()[0]));
Dialog splash = new Dialog("Splash Screen");
splash.setAutoDispose(true);
splash.setTimeout(5000);
splash.show();
RecordStore rs = null;
byte[] buffer = null;
rs = RecordStore.openRecordStore("xxxxxx", true);
if (rs.getNumRecords() > 0) {
buffer = rs.getRecord(rs.getNumRecords());
num = new String(buffer, 0, buffer.length);
rs.closeRecordStore();
offer(num); // a method which displays main form
} else {
rs.closeRecordStore();
registration("xxxxx"); //another method which displays the secondary form
}
在該片段中,顯示對話框/初始屏幕之後所述設備上的空白屏幕。 當我刪除管理RecordStore的代碼時,表單會顯示出來。 我該如何解決這個混亂?
EDIT 2 代碼登記()
Form f = new Form();
f.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
Image img = Image.createImage("logo.png");
f.addComponent(new Label(img));
Label lbl = new Label(msg);
f.addComponent(lbl);
f.addComponent(new Label("xxxxx"));
final TextArea number = new TextArea(1, 10, TextArea.NUMERIC);
f.addComponent(number);
Button btn = new Button("Register");
btn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
//perform rms related activities and move onto offer()
}
});
f.addComponent(btn);
Button help = new Button("Help?");
help.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
//display a help dialog
}
});
f.addComponent(help);
f.addCommandListener(this);
f.show();
你測試了什麼手機? – bharath
諾基亞C3測試 – Farhan
你能告訴我應用程序的jar文件大小嗎? – bharath