Um, "new SAXParserFactory.newInstance();" would be a constructor call
to instantiate an inner class of "SAXParserFactory", called
"newInstance":
public class SAXParserFactory {
public class newInstance {
public newInstance() { }
}
}
... and there is no such thing.
In other words, since you're trying to call a method, not instantiate
a class, take out the "new":
SAXParserFactory spf=new SAXParserFactory.newInstance();
-->
SAXParserFactory spf = SAXParserFactory.newInstance();
-- K
21 марта 2012 г. 0:14 пользователь Alexey Sinyutin
<[email protected]> написал:
> Good time.
> I have problem with SAXParserFactory.newInstance();.
> I have error look like : "SAXParserFactory.newInstance cannot be resolved to
> a type"
> Ccode:
>>>
>>> try{
>>>
>>> URL website=new URL (fullUrl);
>>>
>>> SAXParserFactory spf=new SAXParserFactory.newInstance(); -only in
>>> this line i have error
>>>
>>> SAXParser sp=spf.newSAXParser();
>>>
>>> XMLReader xr=sp.getXMLReader();
>
> }
>
> Part of Import code:
>>>
>>> import javax.xml.parsers.SAXParser;
>>>
>>> import javax.xml.parsers.SAXParserFactory;
>
> How i can resolve this problem?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en