03-07-2012 06:38 AM
im create screen with paging... button load to add more data, is normal on os 6 and os 7... but in os 5 process terminated... i haved create on thread to update ui in invoke later...
it is my code in invoke later :
UiApplication.getUiApplication().invokeLater(
new Runnable() {
public void run() {
// delete(hfmLoad);
for (int i = 0; i < comp.length(); i++) {
lowerScreen.add(list[i]);
HorizontalFieldManager hfmBut = new HorizontalFieldManager(
Field.FIELD_RIGHT);
hfmBut.setMargin(0, 5, 0, 0);
hfmBut.add(but1[i]);
lowerScreen.add(hfmBut);
spasi = new SeparatorField() {
protected void paint(Graphics g) {
g.setColor(Color.GRAY);
int currentStipple = g
.getStipple();
try {
g
.setStipple(0xAAAAAAAA); // Dotted
super.paint(g);
} finally {
g
.setStipple(currentStipple);
}
}
};
spasi.setMargin(0, 5, 5, 5);
lowerScreen.add(spasi);
invalidate();
//lowerScreen.add(new LabelField("Semangat",Field.FOCUSABLE));
}
hfmLoad
.replace(_ourAnimation2, loadBut);
invalidate();
}any solution?
Solved! Go to Solution.
03-07-2012 07:29 AM - edited 03-07-2012 10:22 AM
None of the invalidate() method calls are needed in this code.
For efficiency instead of adding the Field individually, I recommend that you use the addAll method. In your loop, create an array of Fields to add, then use addAll to add the array.
If you do both of these things I suspect your problem will be resolved.
But if not, can you please tell us exactly what messages you see when the process is terminated.
03-07-2012 10:03 AM
thanks a lot peter... method addAll is the solution!