-1

I am making an RPG and I started by making the battle system, then I decided to make the overworld a seperate activity so I copied the Game loop class and made a duplicate, when I switch to the battle mode class, none of the buttons respond and then this error comes up

I believe it may have to do with the fact that they both have their own threads but something isn't right - can anyone help me?

09-15 19:27:20.178: ERROR/ActivityManager(60): ANR in com.this.game (com.this.game/.MyGame)
09-15 19:27:20.178: ERROR/ActivityManager(60): Reason: keyDispatchingTimedOut**
09-15 19:27:20.178: ERROR/ActivityManager(60): Load: 2.16 / 1.44 / 0.87
09-15 19:27:20.178: ERROR/ActivityManager(60): CPU usage from 109904ms to 64ms ago:
09-15 19:27:20.178: ERROR/ActivityManager(60):   mediaserver: 43% = 41% user + 2% kernel / faults: 7794 minor
09-15 19:27:20.178: ERROR/ActivityManager(60):   system_server: 18% = 15% user + 2% kernel / faults: 2642 minor 51 major
09-15 19:27:20.178: ERROR/ActivityManager(60):   logcat: 1% = 0% user + 0% kernel / faults: 32 minor
09-15 19:27:20.178: ERROR/ActivityManager(60):   adbd: 1% = 0% user + 1% kernel / faults: 43 minor
09-15 19:27:20.178: ERROR/ActivityManager(60):   ndroid.launcher: 0% = 0% user + 0% kernel / faults: 744 minor 4 major
09-15 19:27:20.178: ERROR/ActivityManager(60):   m.android.phone: 0% = 0% user + 0% kernel / faults: 280 minor
09-15 19:27:20.178: ERROR/ActivityManager(60):   events/0: 0% = 0% user + 0% kernel
09-15 19:27:20.178: ERROR/ActivityManager(60):   ronsoft.openwnn: 0% = 0% user + 0% kernel / faults: 214 minor 1 major
09-15 19:27:20.178: ERROR/ActivityManager(60):   zygote: 0% = 0% user + 0% kernel / faults: 132 minor 1 major
09-15 19:27:20.178: ERROR/ActivityManager(60):   com.svox.pico: 0% = 0% user + 0% kernel / faults: 135 minor
09-15 19:27:20.178: ERROR/ActivityManager(60):   kswapd0: 0% = 0% user + 0% kernel
09-15 19:27:20.178: ERROR/ActivityManager(60):   rild: 0% = 0% user + 0% kernel / faults: 50 minor 1 major
09-15 19:27:20.178: ERROR/ActivityManager(60):   id.defcontainer: 0% = 0% user + 0% kernel / faults: 121 minor
09-15 19:27:20.178: ERROR/ActivityManager(60):  +ev.bushido.coda: 0% = 0% user + 0% kernel
09-15 19:27:20.178: ERROR/ActivityManager(60):  +ev.bushido.coda: 0% = 0% user + 0% kernel
09-15 19:27:20.178: ERROR/ActivityManager(60): TOTAL: 89% = 77% user + 11% kernel + 0% irq + 0% softirq
Squonk
  • 48,735
  • 19
  • 103
  • 135
GideonKain
  • 744
  • 1
  • 12
  • 27

1 Answers1

0

We really can't answer this question without more information. What I can say is this, if you are new to game development I'd suggest you consider using one of the many excellent game engines out there. Two quite popular engines are:

  1. AndEngine
  2. LibGDX

They are both quite mature and have a strong community of users.

slayton
  • 20,123
  • 10
  • 60
  • 89
  • Um, the game is over 50% complete and works fine - I just don't want to have all the code run in a single activity - the game itself is a class that extends surfaceview and in the onCreate method attaches to a Thread, so when I say duplicate, I mean I made a copy of the SUrfaceView and the Thread and fired them off in a new activity, the new activity starts fine, runs fine, but when I click the button to goto the Battle Activity it issues that error, I just wanted to know what it means – GideonKain Sep 15 '11 at 19:47
  • ANR stands for Android Not Responding, there are lots of things that can cause it. I'd suggest doing some google queries about ANR and this: http://stackoverflow.com/questions/704311/android-how-do-i-investigate-an-anr – slayton Sep 15 '11 at 19:48