title: Android emulator crash if click while processing
body: <p>I've been working on an android app and test it on the emulator. Parts of this app require some processing time, such as login, could take up to 10 seconds. If the app is processing the login, and I clicked anywhere on the emulator screen, it will cause the app to crash -> a force close/wait window will pop up and even I choose to wait, this login process will never complete. <br></p>
  
  <p>I wonder did anybody else encounter this situation? What could I do to avoid user clicking during processing and crash the program? Or on a real phone it is not a problem?</p>
  
  <p>Thanks!</p>
  
  <p>EDIT: This is indeed a UI thread problem and I'm using Mono for Android to write this app, I sort my issues out using methods introduced <a href="http://www.gregshackles.com/2011/04/using-background-threads-in-mono-for-android-applications/comment-page-1/#comment-1872" rel="nofollow">Here!</a></p>
  
  <p>EDIT:
  this is the LOGCAT messages</p>
  
  <pre><code>1-11 00:38:49.165 W/WindowManager(   59): Key dispatching timed out sending to BadumnaAndroidApi1.BadumnaAndroidApi1/badumnaandroidapi1.Activity1
  01-11 00:38:49.165 W/WindowManager(   59): Previous dispatch state: {{KeyEvent{action=1 code=66 repeat=0 meta=0 scancode=28 mFlags=8} to Window{44ed87d0 BadumnaAndroidApi1.BadumnaAndroidApi1/badumnaandroidapi1.Activity1 paused=false} @ 1326241690617 lw=Window{44ed87d0 BadumnaAndroidApi1.BadumnaAndroidApi1/badumnaandroidapi1.Activity1 paused=false} lb=android.os.BinderProxy@4508a900 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{44ed87d0 BadumnaAndroidApi1.BadumnaAndroidApi1/badumnaandroidapi1.Activity1 paused=false}}}
  01-11 00:38:49.175 W/WindowManager(   59): Current dispatch state: {{null to Window{44ed87d0 BadumnaAndroidApi1.BadumnaAndroidApi1/badumnaandroidapi1.Activity1 paused=false} @ 1326242329174 lw=Window{44ed87d0 BadumnaAndroidApi1.BadumnaAndroidApi1/badumnaandroidapi1.Activity1 paused=false} lb=android.os.BinderProxy@4508a900 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{44ed87d0 BadumnaAndroidApi1.BadumnaAndroidApi1/badumnaandroidapi1.Activity1 paused=false}}}
  01-11 00:38:49.276 I/Process (   59): Sending signal. PID: 316 SIG: 3
  01-11 00:38:49.276 I/dalvikvm(  316): threadid=3: reacting to signal 3
  01-11 00:38:49.485 I/dalvikvm(  316): Wrote stack traces to '/data/anr/traces.txt'
  01-11 00:38:49.485 I/Process (   59): Sending signal. PID: 59 SIG: 3
  01-11 00:38:49.485 I/dalvikvm(   59): threadid=3: reacting to signal 3
  01-11 00:38:49.595 I/dalvikvm(   59): Wrote stack traces to '/data/anr/traces.txt'
  01-11 00:38:49.616 I/Process (   59): Sending signal. PID: 114 SIG: 3
  01-11 00:38:49.616 I/dalvikvm(  114): threadid=3: reacting to signal 3
  01-11 00:38:49.625 I/dalvikvm(  114): Wrote stack traces to '/data/anr/traces.txt'
  01-11 00:38:49.636 I/Process (   59): Sending signal. PID: 107 SIG: 3
  01-11 00:38:49.645 I/dalvikvm(  107): threadid=3: reacting to signal 3
  01-11 00:38:49.655 I/dalvikvm(  107): Wrote stack traces to '/data/anr/traces.txt'
  01-11 00:38:49.673 I/Process (   59): Sending signal. PID: 254 SIG: 3
  01-11 00:38:49.865 I/dalvikvm(  254): threadid=3: reacting to signal 3
  01-11 00:38:49.875 I/Process (   59): Sending signal. PID: 246 SIG: 3
  01-11 00:38:49.906 I/dalvikvm(  246): threadid=3: reacting to signal 3
  01-11 00:38:50.085 I/Process (   59): Sending signal. PID: 177 SIG: 3
  01-11 00:38:50.115 I/dalvikvm(  177): threadid=3: reacting to signal 3
  01-11 00:38:50.285 I/Process (   59): Sending signal. PID: 221 SIG: 3
  01-11 00:38:50.345 I/dalvikvm(  221): threadid=3: reacting to signal 3
  01-11 00:38:50.495 I/Process (   59): Sending signal. PID: 169 SIG: 3
  01-11 00:38:50.575 I/dalvikvm(  169): threadid=3: reacting to signal 3
  01-11 00:38:50.695 I/Process (   59): Sending signal. PID: 185 SIG: 3
  01-11 00:38:50.735 I/dalvikvm(  185): threadid=3: reacting to signal 3
  01-11 00:38:50.905 I/Process (   59): Sending signal. PID: 111 SIG: 3
  01-11 00:38:50.905 I/dalvikvm(  111): threadid=3: reacting to signal 3
  01-11 00:38:51.065 I/dalvikvm(  111): Wrote stack traces to '/data/anr/traces.txt'
  01-11 00:38:51.065 I/Process (   59): Sending signal. PID: 205 SIG: 3
  01-11 00:38:51.185 I/dalvikvm(  205): threadid=3: reacting to signal 3
  01-11 00:38:51.275 I/Process (   59): Sending signal. PID: 194 SIG: 3
  01-11 00:38:51.405 I/dalvikvm(  194): threadid=3: reacting to signal 3
  01-11 00:38:51.485 I/Process (   59): Sending signal. PID: 155 SIG: 3
  01-11 00:38:51.605 I/dalvikvm(  155): threadid=3: reacting to signal 3
  01-11 00:38:51.685 I/Process (   59): Sending signal. PID: 149 SIG: 3
  01-11 00:38:51.875 I/dalvikvm(  149): threadid=3: reacting to signal 3
  01-11 00:38:51.885 I/Process (   59): Sending signal. PID: 115 SIG: 3
  01-11 00:38:51.916 I/dalvikvm(  115): threadid=3: reacting to signal 3
  </code></pre>