I am developing an RSS reader. When running this code, localName and uri empty. I am parsing a RSS feed. I am running the following code. The same code is working fine in another android project.
@Override
public void endElement(String uri, String localName, String qName)
throws SAXException {
String name;
if (localName == "" ){
name = qName;
}
else{
name = localName;
}
if (name.equalsIgnoreCase("title")) {
currentPost.setTitle(chars.toString());
}
if (name.equalsIgnoreCase("link")) {
currentPost.setLink(chars.toString());
}
if (name.equalsIgnoreCase("content")
&& currentPost.getContent() == null) {
currentPost.setContent(chars.toString());
}
if (name.equalsIgnoreCase("item")) {
currentPost.setFeed(feed);
Posts.Instance().add(currentPost);
currentPost = new Post();
}
}