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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:25:34+00:00 2026-06-06T13:25:34+00:00

I’m working on an Android game using these tutorials over at Against the Grain

  • 0

I’m working on an Android game using these tutorials over at Against the Grain http://obviam.net/index.php/table-of-contents/ and my program has suddenly decided to have an ANR Key Dispatching Timed Out error whenever I touch the screen.

Basically I have a MainMenuThread class that extends thread which has the main game loop in it, simply calling update and render functions in my MainMenuPanel which extends SurfaceView and handles the actual game.

I load in a bunch of images of square buttons which I lerp from the top of the screen to the bottom, after which I display 4 other images that will be buttons and flash the screen (simple lerp and a call to canvas.drawARGB). Once this has finished, when the user presses on one of the squares for the background it changes to an image of a pressed down square, this did work. Initially I hacked in some code that on touch event looped through each and every square in the background, checked if the event coords were on it and reacted accordingly, I’ve now changed this to be much more streamlined but for some reason I keep getting a KeyDispatchingTimedOut every time I touch the screen.

I was running this on my quad core machine at home which emulated it all just fine (before the streamline) I’m now working on my netbook which can’t even run an android virtual device so I’m debugging on my phone (HTC Hero).

I googled around for answers and found people saying that it could be because it is doing too much work so I stopped it drawing the square background and output a message to logcat on each touch event but I still get the same problem, I also tried launching a new thread on each touch event that handled this for me but that didn’t fix it. The only other thing I’ve seen in google searches is people saying that android can spit out this error if the surface no-longer exists but it almost definitely does.

The only other thing I can think to say is that it doesn’t even get into my logic, my code is:

if(event.getAction() == MotionEvent.ACTION_DOWN)
{
    Log.d(TAG, "Touch event registered");

    int x = (int)event.getX() / squareSize;
    int y = (int)(getHeight() - event.getY()) / squareSize;

    squares[x][y].setTouched(true);
}

and the “Touch event registered” message is never output.

Thanks in advance for any help that can be offered, and as this is my first question on here I hope that this isn’t too long winded/irrelevant.

  • 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-06T13:25:37+00:00Added an answer on June 6, 2026 at 1:25 pm

    It turns out that my phone was faulty >:(

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

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.