×
Namespaces

Variants
Actions
Revision as of 07:12, 8 August 2013 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Adding more than 22 CustomItems on Form cause S60 3rd Edition FP2 devices to hang (Known Issue)

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): S60 3rd Edition FP2 Emulator, Nokia 6210 Navigator
Compatibility
Platform(s):
S60 3rd Edition FP2
Article
Created: schoenke (27 Jul 2008)
Last edited: hamishwillee (08 Aug 2013)
This known issue was originally created by Schoenke and has been verified by Nokia Developer.

Description

If you add more than 22 CustomItems on a Form, the MIDlet will hang up when calling Display.setCurrent() or Display.setCurrentItem(). This means that the Form will not be displayed.

In the debugger you can see that one thread hangs in Form._setCurrentItem() and another one in CustomItemTest.handleSizeChanged().

How to reproduce

See the following code snippet. This code works fine in Series 40 and S60 3rd Edition, FP1 emulators; however, start-up in the latter ones is very slow.

For a cross check, comment out approximately 10 append() statements and rerun the MIDlet. This way it works.

 package main;
 
import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;
 
public class MidletTest extends MIDlet
{
 
public void startApp() {
FormTest frmTest = new FormTest(Display.getDisplay(this));
frmTest.open(1);
}
 
public void destroyApp(boolean b) {
}
 
/**
* Pausing is not supported in NOKIA's Series 40 and
* S60 MIDP implementations.
*/

public void pauseApp() {
}
 
public void quit() {
notifyDestroyed();
}
}

The Form:

 package main;
 
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
 
import main.CustomItemTest;
 
public class FormTest extends Form {
 
private final Display display;
 
private final CustomItemTest item00;
private final CustomItemTest item01;
private final CustomItemTest item02;
private final CustomItemTest item03;
private final CustomItemTest item04;
private final CustomItemTest item05;
private final CustomItemTest item06;
private final CustomItemTest item07;
private final CustomItemTest item08;
private final CustomItemTest item09;
private final CustomItemTest item10;
private final CustomItemTest item11;
private final CustomItemTest item12;
private final CustomItemTest item13;
private final CustomItemTest item14;
private final CustomItemTest item15;
private final CustomItemTest item16;
private final CustomItemTest item17;
private final CustomItemTest item18;
private final CustomItemTest item19;
private final CustomItemTest item20;
private final CustomItemTest item21;
private final CustomItemTest item22;
private final CustomItemTest item23;
private final CustomItemTest item24;
private final CustomItemTest item25;
private final CustomItemTest item26;
private final CustomItemTest item27;
private final CustomItemTest item28;
private final CustomItemTest item29;
 
public FormTest(Display pDisplay) {
super("test screen");
 
this.display = pDisplay;
 
this.item00 = new CustomItemTest();
this.item01 = new CustomItemTest();
this.item02 = new CustomItemTest();
this.item03 = new CustomItemTest();
this.item04 = new CustomItemTest();
this.item05 = new CustomItemTest();
this.item06 = new CustomItemTest();
this.item07 = new CustomItemTest();
this.item08 = new CustomItemTest();
this.item09 = new CustomItemTest();
this.item10 = new CustomItemTest();
this.item11 = new CustomItemTest();
this.item12 = new CustomItemTest();
this.item13 = new CustomItemTest();
this.item14 = new CustomItemTest();
this.item15 = new CustomItemTest();
this.item16 = new CustomItemTest();
this.item17 = new CustomItemTest();
this.item18 = new CustomItemTest();
this.item19 = new CustomItemTest();
this.item20 = new CustomItemTest();
this.item21 = new CustomItemTest();
this.item22 = new CustomItemTest();
this.item23 = new CustomItemTest();
this.item24 = new CustomItemTest();
this.item25 = new CustomItemTest();
this.item26 = new CustomItemTest();
this.item27 = new CustomItemTest();
this.item28 = new CustomItemTest();
this.item29 = new CustomItemTest();
 
append(this.item00);
append(this.item01);
append(this.item02);
append(this.item03);
append(this.item04);
append(this.item05);
append(this.item06);
append(this.item07);
append(this.item08);
append(this.item09);
append(this.item10);
append(this.item11);
append(this.item12);
append(this.item13);
append(this.item14);
append(this.item15);
append(this.item16);
append(this.item17);
append(this.item18);
append(this.item19);
 
append(this.item20);
append(this.item21);
append(this.item22);
append(this.item23);
append(this.item24);
append(this.item25);
append(this.item26);
append(this.item27);
append(this.item28);
append(this.item29);
}
 
public void open(int pFocus) {
display.setCurrentItem(get(pFocus));
}
}

The CustomItem:

 package main;
 
import javax.microedition.lcdui.CustomItem;
import javax.microedition.lcdui.Graphics;
 
public class CustomItemTest extends CustomItem {
 
public CustomItemTest() {
super("");
}
 
protected void paint(Graphics pGraphics, int pWidth, int pHeight) {
pGraphics.setColor(0x00ffffaa);
pGraphics.fillRect(1, 1, pWidth - 2, pHeight - 2);
pGraphics.setColor(0x00000000);
pGraphics.drawString("TEST", 0, 0, Graphics.TOP | Graphics.LEFT);
}
 
protected int getMinContentHeight() {
return 20;
}
 
protected int getMinContentWidth() {
return 40;
}
 
protected int getPrefContentHeight(int arg0) {
return 20;
}
 
protected int getPrefContentWidth(int arg0) {
return 40;
}
}

Solution

This issue is expected to be fixed in future software versions starting from S60 5th Edition.

This page was last modified on 8 August 2013, at 07:12.
160 page views in the last 30 days.