Hi thanhlnh,
I couldn't reproduce the NullPointerException on neither Nokia SDK 1.1 nor S40_5th_Edition_SDK when I tested your code with LWUIT 1.5 and the following minor modifications:
Code:
Vector tagVector = null;
InputStream is = null;
InputStreamReader isr = null;
try {
is = getClass().getResourceAsStream("file.xml");
isr = new InputStreamReader(is, "utf-8");
XMLParser myParser = new XMLParser();
Element e = myParser.parse(isr);
tagVector = e.getChildrenByTagName("Smiley");
System.out.println("Size of Elements: " + tagVector.size());
} catch (Exception ex) {
return;
}
The last print statement could be reached and I could get "Size of Elements: 2" on my console.
I only copied pasted your xml file, called it file.xml and placed it in the res directory of my Eclipse's working project. Instead of using the instance class, I used the method getClass().
This could be related to how Setting.EMOTICON_PATH is evaluated on runtime.
Also ensure that you are using the latest version of LWUIT.