title: Android - Changing Activity
body: <p>I have problem with changing activity. I added the line to AndroidManifest and it doesn't work. It means, there's error after click of "NowaGra" ImageButton. ( Error - "Sorry !, The Application Gra_Milionerzy(process gra_Milionerzy.Gra) has stopped unexpectdelly. Please try again )</p>
  
  <p>It's main Activity ( Gra - Game in English )</p>
  
  <pre><code>    package gra_Milionerzy.Gra;
  
  import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.ImageButton;
  
  public class Gra extends Activity {
      /** Called when the activity is first created. */
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
  
          /*   Menu Gry */  
  
            ImageButton Nowa_Gra = (ImageButton)this.findViewById(R.id.nowa_gra);
            Nowa_Gra.setOnClickListener(new OnClickListener()
              {
        public void onClick(View v)
         {
         Intent intent = new Intent(Gra.this, NowaGra.class);
          startActivity(intent);   
            }      
  
              });
  
  
            ImageButton Profile = (ImageButton)this.findViewById(R.id.profile);
            Profile.setOnClickListener(new OnClickListener()
              {
        public void onClick(View arg0)
         {
          finish();
         }
              });
  
            ImageButton OAutorze = (ImageButton)this.findViewById(R.id.o_autorze);
            OAutorze.setOnClickListener(new OnClickListener()
              {
        public void onClick(View arg0)
         {
          finish();
         }
              });
  
            ImageButton Ustawienia = (ImageButton)this.findViewById(R.id.ustawienia);
            Ustawienia.setOnClickListener(new OnClickListener()
              {
        public void onClick(View arg0)
         {
          finish();
         }
              });
  
            /*  Koniec Menu Gry  */
  
  
            /*  Kola Ratunkowe  */
  
  
  
  
      }
  }
  </code></pre>
  
  <p>and here's NowaGra ( NewGame ;P )</p>
  
  <pre><code>package gra_Milionerzy.Gra;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.ImageButton;
  
  public class NowaGra extends Activity {
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
         finish();
  
          /*   Kola Ratunkowe */  
  
  
  
  
  
      }
  }
  </code></pre>
  
  <p>and AndroidManifest </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="gra_Milionerzy.Gra"
        android:versionCode="1"
        android:versionName="1.0"&gt;
      &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt;
          &lt;activity android:name=".Glowna"
                    android:label="@string/app_name"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
       &lt;activity android:name=".NowaGra"&gt;&lt;/activity&gt;
      &lt;/application&gt;
  
  
  &lt;uses-sdk android:minSdkVersion="1"&gt;&lt;/uses-sdk&gt;
  &lt;/manifest&gt; 
  </code></pre>
  
  <p>plus LogCat</p>
  
  <pre><code>12-30 12:43:06.738: ERROR/AndroidRuntime(1379): FATAL EXCEPTION: main
  12-30 12:43:06.738: ERROR/AndroidRuntime(1379): android.content.ActivityNotFoundException: Unable to find explicit activity class {gra_Milionerzy.Gra/gra_Milionerzy.Gra.NowaGra}; have you declared this activity in your AndroidManifest.xml?
  12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)
  12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
  12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at android.app.Activity.startActivityForResult(Activity.java:2817)
  12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at android.app.Activity.startActivity(Activity.java:2923)
  12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at gra_Milionerzy.Gra.Gra$1.onClick(Gra.java:25)
  12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at android.view.View.performClick(View.java:2408)
  12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at android.view.View$PerformClick.run(View.java:8816)
  12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at android.os.Handler.handleCallback(Handler.java:587)
  12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at android.os.Handler.dispatchMessage(Handler.java:92)
  12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at android.os.Looper.loop(Looper.java:123)
  12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at android.app.ActivityThread.main(ActivityThread.java:4627)
  12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at java.lang.reflect.Method.invokeNative(Native Method)
  12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at java.lang.reflect.Method.invoke(Method.java:521)
  12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
  12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>And what I'm doing wrong ? Any ideas ?</p>
  
  <p><em><strong></em>__<em>_</em>__<em>_</em>__<em>_</em>__<em>_</em>__<em>_</em>__<em>_</em>____</strong>-
  ANWSER - The bad wrote in AndroidManifest</p>