title: Android.Intent[Another activity]
body: <p><strong>My task</strong>: after button pressed, - second activity opening.<br>
  <strong>Problem</strong>: after button pressed, - "application closed unexpectedly".<br>
  <strong>LogCat said</strong> (short version): </p>
  
  <blockquote>
    <p>04-10 21:25:24.968: E/AndroidRuntime(13032):
    java.lang.RuntimeException: Unable to start activity
    ComponentInfo{cat.dog.szosta/cat.dog.szosta.ListaOcenActivity}:
    java.lang.NullPointerException</p>
  </blockquote>
  
  <p><strong>LogCat said</strong> (full version):<br>
  <a href="https://drive.google.com/file/d/0B1jfkoUAwYVhYmFvSzBmS2ZIaU0/edit?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/0B1jfkoUAwYVhYmFvSzBmS2ZIaU0/edit?usp=sharing</a></p>
  
  <p><strong>First activity code (partial)</strong>:</p>
  
  <pre><code>private Button   mOcenyPrzycisk;
  protected void onCreate(Bundle savedInstanceState) 
  {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.fragment_main);
    mOcenyPrzycisk = (Button)findViewById(R.id.ocenyPrzycisk);
    mOcenyPrzycisk.setOnClickListener(
      new View.OnClickListener() 
     {
        @Override
        public void onClick(View v) 
        {
         Intent intencja = new Intent(MainActivity.this, ListaOcenActivity.class); 
         startActivity(intencja);
        }
     }
                                     );
  }
  </code></pre>
  
  <p><strong>Second activity(partial)</strong>:</p>
  
  <pre><code>        protected void onCreate(Bundle savedInstanceState) 
  {
                  super.onCreate(savedInstanceState);
                  setContentView(R.layout.activity_lista_ocen);
  
                  mprzyciskWroc = (Button) findViewById(R.id.przyciskWroc);
      /*line 28*/ mprzyciskWroc.setOnClickListener(
                  new    View.OnClickListener()
                        {
                          public void onClick (View v)
                          {
                              finish();
                          }
                        }
                                                  );
  }
  </code></pre>
  
  <p><strong>P.S</strong>: second activity declared in AndroidManifest.xml</p>
  
  <p><strong>I was looking in (didn't help)</strong>:<br>
  <a href="https://stackoverflow.com/questions/736571/using-intent-in-an-android-application-to-show-another-activity">Using Intent in an Android application to show another activity</a>
  <br>
  <a href="https://stackoverflow.com/questions/7704825/android-intents">android intents</a>
  <br>
  <strong>Thanks in advance!</strong></p>