August 25, 2006
SonyEricsson Form bug
Yesterday I've found interesting bug on my SonyEricsson K600i. I tested my MIDP1.0 code for cleaning Form:
and it always threw the NullPointerException in delete() method. The situation was only at the real device, not the S-E or WTK emulator. Maybe the problem is because of Gauge element which is the last in my form, I didn't check this. But the solution is simple: to delete(size()-1) element each iteration. It works :)
for(int i=0; i<form.size()-1; i++) form.delete(0);
and it always threw the NullPointerException in delete() method. The situation was only at the real device, not the S-E or WTK emulator. Maybe the problem is because of Gauge element which is the last in my form, I didn't check this. But the solution is simple: to delete(size()-1) element each iteration. It works :)