Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8473209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:17:10+00:00 2026-06-10T17:17:10+00:00

I am reading Hello Android book and I am writing the code from the

  • 0

I am reading Hello Android book and I am writing the code from the book in eclipse but the buttons not working. Why is that?

Sudoku/src/org.example.sudoku/Sudoku.java

package org.example.sudoku;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;

public class Sudoku extends Activity implements OnClickListener {
private static final String TAG = "Sudoku";

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

    // Set up click listeners for all the buttons
    View continueButton = findViewById(R.id.continue_button);
    continueButton.setOnClickListener(this);
    View newButton = findViewById(R.id.new_button);
    newButton.setOnClickListener(this);
    View aboutButton = findViewById(R.id.about_button);
    aboutButton.setOnClickListener(this);
    View exitButton = findViewById(R.id.exit_button);
    exitButton.setOnClickListener(this);
 }



 // ...
 public void onClick(View v) {
     switch (v.getId()) {
     case R.id.about_button:
         Intent i = new Intent(this, About.class);
         startActivity(i);
         break;
     // More buttons go here (if any) ...

     }
  }
}

Sudoku/src/org.example.sudoku/About.java

package org.example.sudoku;

import android.app.Activity;
import android.os.Bundle;

public class About extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.about);
}
 }

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="org.example.sudoku"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="15" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
             android:name=".MainActivity"
             android:label="@string/title_activity_main" >
             <intent-filter>
                  <action android:name="android.intent.action.MAIN" />

                  <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
        </activity>
        <activity android:name=".About"
            android:label="@string/about_label">     
        </activity>            

    </application>

 </manifest>

I click in About button, but not working and not run activity. if you need another files of program, tell me.
Please help me.
Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T17:17:12+00:00Added an answer on June 10, 2026 at 5:17 pm

    Try this. In Manifest file you write MainActivity please change it to Sudoku.

    For this error cannot convert from View to Button

    You need to cast the view to Button:

    Button aboutButton  = (Button)findViewById(android.R.id.aboutButton );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm reading the book 'Hello, Android'. In the Sudoku example, it uses a options
Im reading a book Pragmatics: Hello Android and copy the code word for word
I got the Hello, Android program to work after reading the tutorials from Google's
Hello I understand from reading advice on this site that scripts should go at
I'm reading from a file that reads something like all on one line: Hello
Hello I'm using a configuration file from src/main/resources in my java application. I'm reading
I was reading the Gallery View tutorial : http://developer.android.com/resources/tutorials/views/hello-gallery.html . Is there anyway I
Hello I was reading through some other posts about my issue on SO that
Hello and thanks to everyone for reading my question. I've been working on a
Hello, thanks for reading my question. I have a string that I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.