Sudoku.java代码如下package com.example.android.apis;import android.app.Activity;
import android.os.Bundle;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;public class Sudoku extends Activity 
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        //Set up click linsteners for all the buttons
        View continueButton = this.findViewById(R.id.continue_buttion);
        continueButton.setOnClickListener((OnClickListener) this);
        View newButton=this.findViewById(R.id.new_buttion);
        newButton.setOnClickListener((OnClickListener) this);
        View aboutButton=this.findViewById(R.id.about_buttion);
        aboutButton.setOnClickListener((OnClickListener) this);
        View exitButton=this.findViewById(R.id.exit_buttion);
        exitButton.setOnClickListener((OnClickListener) this);
        
    }
}
public class Sudoku extends Activity implements OnClickListener
{
  //
@Override
public void onClick(View v) 
{
// TODO Auto-generated method stub
switch(v.getId())
{
case R.id.about_buttion:
   Intent i=new Intent(this,About.class);
   startActivity(i);
   break;
  //
}
}
}

解决方案 »

  1.   

    About.java代码如下
    package com.example.android.apis;import android.app.Activity;
    import android.os.Bundle;public class About extends Activity {
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);        
            setContentView(R.layout.about);
        }
    }
      

  2.   

    about.xml代码如下
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:background="@color/background"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:padding="30dip"
        android:orientation="horizontal">
      <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        >
      <TextView  
        android:text="@string/main_title"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_gravity="center"
        android:layout_marginBottom="25dip"
        android:textSize="24.5sp"
        />
      <Button
        android:id="@+id/continue_buttion"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/continue_label"
        />
      <Button
        android:id="@+id/new_buttion"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/new_game_label"
        />
      <Button
        android:id="@+id/about_buttion"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/about_label"
        />
      <Button
        android:id="@+id/exit_buttion"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/exit_label" />
      </LinearLayout>
    </LinearLayout>
      

  3.   

    main.xml代码如下
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:background="@color/background"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:padding="30dip"
        android:orientation="horizontal">
      <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        >
      <TextView  
        android:text="@string/main_title"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_gravity="center"
        android:layout_marginBottom="25dip"
        android:textSize="24.5sp"
        />
      <Button
        android:id="@+id/continue_buttion"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/continue_label"
        />
      <Button
        android:id="@+id/new_buttion"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/new_game_label"
        />
      <Button
        android:id="@+id/about_buttion"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/about_label"
        />
      <Button
        android:id="@+id/exit_buttion"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/exit_label" />
      </LinearLayout>
    </LinearLayout>
      

  4.   

    怎么两个叫 Sudoku 的类哦。
      

  5.   

    啥子错,编译错误还是啥呢?求LOG
      

  6.   

    楼主如果是用Eclipse开发环境,建议先熟悉使用Eclipse,比如LogCat,碰到问题,LogCat中都会反映出来,把LogCat中的信息贴上来看看。