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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:24:35+00:00 2026-06-05T06:24:35+00:00

I am making a game and would like To display the score in such

  • 0

I am making a game and would like To display the score in such a fashion that if my score is 0 and is increased by 10, then the score should increment through all of the numbers from 0 to 10. After reaching the new score it should stop, for at least a small pause.

If, again, the score is increased by another 10, the scoreboard should increment through every number from 10 to 20 and then stop again.

I have tried using handlers but unsuccessful in getting them a pause or stop, in any way.

The example in this video demonstrates what I am trying to accomplish. If you look at the scoreboard in the top right, you will see the score constantly incrementing. Here is the url in case the above link does not work: http://www.youtube.com/watch?v=NdZ8YupmEmA&feature=fvwrel

This is the code for my Runnable to increment the score.

final Handler mHandler=new Handler();
    mRunnable=new Runnable() {

        public void run() {
            String s = null;
                   ++i;
                   s= new Integer(i).toString();    
                   tv.setText(s);
                   mHandler.postDelayed(mRunnable,1000);       

                }

        /*protected void onStop() {
            mHandler.removeCallbacks(mRunnable);
        }*/
    };

    mHandler.postDelayed(mRunnable,1000);

What I specifically need is how to get the code to stop counting.

  • 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-05T06:24:38+00:00Added an answer on June 5, 2026 at 6:24 am

    You can simply print all the numbers between 2 end points.
    Say:

    int counter = 0;
    while(counter%10 != 0)
    {
    textView.setText(counter.toString());
    counter++;
    }
    

    And then again continue with the loop, just start with 11 this time,not 0.

    I’m not sure it’ll work as you want, like in your Temple Run example. I would want to add a little sleep() of very small amount, but yesterday I was advised not use sleep() method in Android development.

    EDIT:

    Ok. This tutorial seems pretty easy to handle. You can apply the same logic to your score display mechanism using Handler(as you probably guessed).

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

Sidebar

Related Questions

I am making a game. I would like to have a joystick that moves
I built a slideshow/decision-making game in Flash but would like to try to redo
I am making a small game in flash, I would like to track scores
I am making simple graphical game in WinForms and currently I would like to
I am making a racing game and I would like to print some information
I'm making a highscorelist for my XNA game. I would like to make it
I'm making a game that displays some numbers on a canvas (score, time, etc).
I'm making a game and would like to have a background loop of game
I'm making a small game in Java and would like to add a Quake
Im making a fairly big game for Mac appstore, and i would like 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.