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 6550057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:10:11+00:00 2026-05-25T12:10:11+00:00

I’m pretty new to Android and I’m trying to program some very easy application

  • 0

I’m pretty new to Android and I’m trying to program some very easy application with a button and a callback to a new Intent (a new window basically).

This is the code:

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    //Onclick "Start Game" button
    start = (Button) findViewById(R.id.startGame);
    tv =  (TextView) findViewById(R.id.textView1);
    start.setOnClickListener(new Button.OnClickListener(){
        @Override
        public void onClick(View v) {
            tv.setText("clicked");
            Intent i = new Intent(MainActivity.this, Level1Activity.class);
            startActivity(i);
        }
    });
[...]

As you can see I have a button (startGame) and a textView (textView1). My problem is simply that when I click on the startGame button, nothing happens (neither the TextView changes to “clicked” nor the screen changes). The button as well as the TextView are set up correctly since Eclipse doesn’t complain, but still the thing doesn’t work.

Here is the XML snippet of the view:

<Button android:id="@+id/startGame" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Start Game"></Button>
<TextView android:text="change" android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>

I believe my problem is really stupid and I just can’t see it.

Thanks

EDIT:

I discovered that the problem was related to the fact that I have more than one button in the view, thus more than one callback (on different buttons of course). As soon as I commented the other callbacks, the startGame button started working as expected.

  • 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-05-25T12:10:12+00:00Added an answer on May 25, 2026 at 12:10 pm

    you have to add in your manifest file one tag then it will work fine. And the tag is ->

    1. activity android:name=”Level1Activity”

    remember add this tag within application tag of your manifest file,rest your code is fine. Try it definitely going to work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka

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.