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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:18:15+00:00 2026-05-25T13:18:15+00:00

I am a noob learning Android and making my own little demo project at

  • 0

I am a noob learning Android and making my own little demo project at the same time.

Basically, when the user starts my app it shows levels.java with 8 buttons, when the user clicks the 8th button this fires:

public void button_clicked8(View v) {
        text1.setText("clicked 8");
        startActivity(new Intent(this, GameScreen.class));
}

which starts my main gamescreen class where the simple game is played.

If the user gets the math problem wrong 3 times, the game is over and I fire this code:

r_settings.setGameStarted(false);
        r_settings.setGameOver(0);
        r_settings.setInternalLevel(0);
        r_settings.setDisplayLevel(0);

        this.finish();

which basically resets some static variables and sends the user back to the levels.java screen.

So far all of the above works like a charm, in the levels screen if the user presses the 8 button again the game starts again, the problem is this works for around 4 times, on the 4th or 5th time it goes to the gamescreen but nothing works… and then in logcat I get this error:
http://imageshack.us/photo/my-images/546/68081548.png/
http://imageshack.us/photo/my-images/59/93717315.png/
(you need to click the image to see it full size)

Where am I going wrong?

Thanks!
R

  • 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-25T13:18:16+00:00Added an answer on May 25, 2026 at 1:18 pm

    Well, you get a NullPointerException at GameScreen.java:64. Does it work after you fix that?

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

Sidebar

Related Questions

I am a noob learning android and building a simple game at the same
I have a noob question but he, i'm learning :-) I'm making a form
I am a noob learning Android via a book, i have a quick question.
Am a noob learning Android via a book and for threading I see there
I'm learning Objective-C, noob question. I'm working on a project in Xcode that requires
I just started learning C#. Sorry for the noob question. My first training app
I'm learning Scala, so this is probably pretty noob-irific. I want to have a
In advance: sorry for the noob question but I'm learning Cocoa & Objective-C and
I'm a real noob who just started learning 3d programming and i have a
Okay,I've been following this tutorial http://coenraets.org/blog/android-samples/androidtutorial/ Basically it gives me exactly what i need

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.