Why does my Android game crash?
<p>On the road of building my own game, I got a big error. I looked through all the code to find something that's wrong,but I couldn't find it.</p>

<p>My app's code is for something like this:</p>

<p>Show a menu with 5 buttons and 1 label. If the new game button is clicked call the startgame() function that will start the game class; that will start the gameview class. After that on the screen should appear just a colored screen, nothing more, but it doesn't...it actually crashes.</p>

<p>Here's the code:</p>

<p>BeginActivity.Java:</p>

<pre><code>    import android.content.Intent;
    import android.os.Bundle;
    import android.app.Activity;
    import android.view.View;
    import android.view.View.OnClickListener;
    import android.view.Menu;
    import android.view.MenuInflater;
    import android.view.MenuItem;
    import android.app.AlertDialog;
    import android.util.Log;
    import android.content.DialogInterface;

    public class BeginActivity extends Activity implements OnClickListener {

public void onClick(View v) {
    switch (v.getId()){
    case R.id.newgame:
        startgame();
        break;
    }
    // TODO Auto-generated method stub

 }


 /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.main);

     View continueButton = findViewById(R.id.continuebutton);
     continueButton.setOnClickListener(this);

     View newButton = findViewById(R.id.newgame);
     newButton.setOnClickListener(this);

    View aboutButton = findViewById(R.id.aboutbutton);
    aboutButton.setOnClickListener(this);

    View achievButton = findViewById(R.id.achievbutton);
    achievButton.setOnClickListener(this);

    View exitButton = findViewById(R.id.exit);
    exitButton.setOnClickListener(this);




    }
    private void startgame() {

    Intent intent = new Intent(ThinkyoursmartActivity.this, Game.class);
    startActivity(intent);


     }
  }
</code></pre>

<p>Game.Java:</p>

<pre><code>    public class Game extends Activity {

private Gameview Gameview;

   @Override
   protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      Gameview = new Gameview(this);
      setContentView(Gameview);
      Gameview.requestFocus();
   }

     }
</code></pre>

<p>GameView.Java:</p>

<pre><code>    public class Gameview extends View{

private final Game Game;
public Gameview(Context context) {
    super(context);
    this.Game = (Game) context;
    setFocusable(true);
    setFocusableInTouchMode(true);
    // TODO Auto-generated constructor stub
}

@Override
   protected void onDraw(Canvas canvas) {
    // Draw the background...
      Paint background = new Paint();
      background.setColor(getResources().getColor(
            R.color.puzzle_background));

      canvas.drawRect(0, 0, getWidth(), getHeight(), background);


}
    }
</code></pre>

<p>On the LOG:</p>

<pre><code>10-28 16:38:39.949: ERROR/AndroidRuntime(333): FATAL EXCEPTION: main
10-28 16:38:39.949: ERROR/AndroidRuntime(333): android.content.ActivityNotFoundException: Unable to find explicit activity class {think.smart/think.smart.Game}; have you declared this activity in your AndroidManifest.xml?
10-28 16:38:39.949: ERROR/AndroidRuntime(333):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1405)
10-28 16:38:39.949: ERROR/AndroidRuntime(333):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
10-28 16:38:39.949: ERROR/AndroidRuntime(333):     at android.app.Activity.startActivityForResult(Activity.java:2827)
10-28 16:38:39.949: ERROR/AndroidRuntime(333):     at android.app.Activity.startActivity(Activity.java:2933)
10-28 16:38:39.949: ERROR/AndroidRuntime(333):     at think.smart.ThinkyoursmartActivity.startgame(ThinkyoursmartActivity.java:58)
10-28 16:38:39.949: ERROR/AndroidRuntime(333):     at think.smart.ThinkyoursmartActivity.onClick(ThinkyoursmartActivity.java:22)
10-28 16:38:39.949: ERROR/AndroidRuntime(333):     at android.view.View.performClick(View.java:2485)
10-28 16:38:39.949: ERROR/AndroidRuntime(333):     at android.view.View$PerformClick.run(View.java:9080)
10-28 16:38:39.949: ERROR/AndroidRuntime(333):     at android.os.Handler.handleCallback(Handler.java:587)
10-28 16:38:39.949: ERROR/AndroidRuntime(333):     at android.os.Handler.dispatchMessage(Handler.java:92)
10-28 16:38:39.949: ERROR/AndroidRuntime(333):     at android.os.Looper.loop(Looper.java:123)
10-28 16:38:39.949: ERROR/AndroidRuntime(333):     at android.app.ActivityThread.main(ActivityThread.java:3683)
10-28 16:38:39.949: ERROR/AndroidRuntime(333):     at java.lang.reflect.Method.invokeNative(Native Method)
10-28 16:38:39.949: ERROR/AndroidRuntime(333):     at java.lang.reflect.Method.invoke(Method.java:507)
10-28 16:38:39.949: ERROR/AndroidRuntime(333):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
10-28 16:38:39.949: ERROR/AndroidRuntime(333):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
10-28 16:38:39.949: ERROR/AndroidRuntime(333):     at dalvik.system.NativeStart.main(Native Method)
10-28 16:38:39.959: WARN/ActivityManager(67):   Force finishing activity think.smart/.ThinkyoursmartActivity
10-28 16:38:40.480: WARN/ActivityManager(67): Activity pause timeout for HistoryRecord{406ee178 think.smart/.ThinkyoursmartActivity}
10-28 16:38:51.975: WARN/ActivityManager(67): Activity destroy timeout for HistoryRecord{406ee178 think.smart/.ThinkyoursmartActivity}
</code></pre>
