Force Stop after resume and touching Touchscreen

  • Replies:2
  • OpenNot stickiedUnanswered
  • Forum posts: 2

Oct 20, 2010 8:54:19 PM via Website

Hi All,
I have been developing a game for sometime and I hope someone can help me with the following problem I have. The game involves touching the screen, which works fine. When I press back I save the state of the variable required for the game to resume. Upon resume, the game seems to be running fine i.e. the timer gets it's previous state and continues to decrease as expected. The problem arises when the onTouch(View v, MotionEvent event) event is triggered. I have removed all code from this function and get the error below when the event is triggered.

Activity blastem (in Application blastem is not responding). I can force close or wait.

The debug from logcat is below. I have am not sure how to fix this issue but guessing it is really simple. I would be grateful if someone can help me.

Thanks in advance,
Karl Evans

I/ActivityManager( 67): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.blastem/.Blastem }
W/ActivityManager( 67): Launch timeout has expired, giving up wake lock!
W/ActivityManager( 67): Activity idle timeout for HistoryRecord{43f02430 com.blastem/.Blastem}
W/WindowManager( 67): Key dispatching timed out sending to com.blastem/com.blastem.Blastem
W/WindowManager( 67): Previous dispatch state: {{KeyEvent{action=1 code=82 repeat=0 meta=0 scancode=229 mFlags=8} to Window{43ebb850 Keyguard paused=false} @ 1287597163655 lw=Window{43ebb850 Keyguard paused=false} lb=android.view.ViewRoot$W@43f1bd08 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{43ebb850 Keyguard paused=false}}}
W/WindowManager( 67): Current dispatch state: {{null to Window{43f7ebe8 com.blastem/com.blastem.Blastem paused=false} @ 1287597364345 lw=Window{43f7ebe8 com.blastem/com.blastem.Blastem paused=false} lb=android.os.BinderProxy@43fcd648 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{43f7ebe8 com.blastem/com.blastem.Blastem paused=false}}}
I/Process ( 67): Sending signal. PID: 278 SIG: 3
I/dalvikvm( 278): threadid=3: reacting to signal 3
I/Process ( 67): Sending signal. PID: 67 SIG: 3
I/dalvikvm( 67): threadid=3: reacting to signal 3
  • Forum posts: 775

Oct 21, 2010 4:26:42 AM via Website

A force close on a touch event, usually means that your code in the onTouchEvent is taking too long to process.

Have you tried clicking wait, instead of force close, to see what happens?

You say you've taken all the code out of the onTouchEvent function?

In your logcat you have this line:
Key dispatching timed out sending to com.blastem/com.blastem.Blastem
Which may mean that your code for processing key events is taking too long. What code is in your onKeyDown function or your key listener?
  • Forum posts: 2

Oct 21, 2010 9:19:55 PM via Website

Hi Jeremiah,

Thank you for your quick response and for taking the time to reply. I have only had time to test the Force wait point at present and this makes no difference to the Force close issue.
I will spend some time working through the points you raised and the fact that the onTouchEvent is taking too long. I decided to upload the app to my phone and surprisingly I get a different error than the force close on the emulator. The phone presents a Black screen when returning after pressing the back button. I have a feeling that I am not restoring my data correctly, which is causing the onTouchEvent to fail.
I will keep you updated on my progress especially if I manage to resolve the issue.

Thanks again,