开发者

android ANR after switching to a new activity

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):   media开发者_如何学运维server: 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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜