title: Android SAXParser cannot resolve symbol 'newInstance()'
body: <p>I'm trying to learn XML parsing by using SAXParser, I've writed simple code based on tutorial, app reading xml file from URL and showing current temperature in selected city, but android studio shows me an error in line:<code>SAXParserFactory spf = new SAXParserFactory.newInstance();</code> with message <code>Cannot resolve symbol 'newInstance()'</code>  and when i try to run app throws error <code>cannot find symbol class newInstance</code></p>
  
  <p>I've searched all over and everybody uses the same code with <code>.newInstance();</code> after <code>SAXParserFactory();</code> . I know that SAXPArser is pretty old and all tutorials/articles about SAX are from 2011/12, so maybe something changed since then? someone could give me a clue what could be wrong?</p>
  
  <p>here is my main java class:</p>
  
  <pre><code>&lt;pre&gt;package com.mycompany.weatherxmlparser;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  import android.widget.EditText;
  import android.widget.TextView;
  
  import org.xml.sax.InputSource;
  import org.xml.sax.XMLReader;
  
  import java.net.URL;
  
  import javax.xml.parsers.SAXParser;
  import javax.xml.parsers.SAXParserFactory;
  
  
  public class MainActivity extends Activity {
  
      String baseURL = "http://api.openweathermap.org/data/2.5/weather?q=";
      String koncowkaURL = "&amp;mode=xml";
      TextView tv;
      EditText city;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          Button b = (Button) findViewById(R.id.button);
          tv = (TextView)findViewById(R.id.txtview);
          city = (EditText)findViewById(R.id.etcity);
  
  
          b.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  //pobieranie wpisanego miasta i stanu/kraju
                  String c = city.getText().toString();
  
  
                  //laczenie adresu url
                  StringBuilder URL = new StringBuilder(baseURL);
                  URL.append(c + koncowkaURL);
                  String fullURL = URL.toString();
  
                  try {
                      URL website = new URL(fullURL);
                      //ustawianie xmlreadera do pobierania danych
                      SAXParserFactory spf = new SAXParserFactory.newInstance();
                      SAXParser sp = spf.newSAXParser();
                      XMLReader xr = sp.getXMLReader();
  
                      //ustawianie handlera
                      HandlingXMLStuff doingWork = new HandlingXMLStuff();
                      xr.setContentHandler(doingWork);
                      //parsowanie xml'a
                      xr.parse(new InputSource(website.openStream()));
                      //ustawianie tekstu
                      String information = doingWork.getInformation();
                      tv.setText(information);
  
  
  
                  } catch (Exception e){
                      tv.setText("error!");
                  }
  
  
              }
          });
      }
  
  &lt;code&gt;
  </code></pre>