概述
我一直在工作的Android应用程序,并在模拟器上测试它。此应用程序的某些部分需要一些处理时间,例如登录,可能需要长达10秒。如果应用程序正在处理登录,并且我在模拟器屏幕上的任意位置单击,它将导致应用程序崩溃 - >强制关闭/等待窗口将弹出,即使我选择等待,此登录过程也永远不会完成。
Android模拟器崩溃,如果点击时处理
我想知道有其他人遇到这种情况吗?我能做些什么来避免用户在处理过程中点击并使程序崩溃?或者在真实的手机上,这不是问题?
谢谢!
编辑:这确实是一个UI线程的问题,我使用的是单声道为Android编写这个程序,我在我的问题出使用介绍Here!
编辑方法排序: 这是logcat的消息
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} [email protected] 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} [email protected] 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
2012-01-10
lynnyilu
+0
有没有关于LogCat的任何信息可能的原因导致这样的崩溃? –
2012-01-11 00:02:49
+2
你确定这是一个崩溃?也许你只是在UI线程中进行处理,并且你的应用程序挂起(因此,出现强制关闭选项的窗口)。 –
2012-01-11 00:23:51
+0
感谢@ user1234567,我对android很陌生,所以你的意思是我不能在UI线程中处理,否则会出现这种情况? –
2012-01-11 00:38:20
最后
以上就是追寻蓝天为你收集整理的android模拟器崩溃,Android模拟器崩溃,如果点击时处理的全部内容,希望文章能够帮你解决android模拟器崩溃,Android模拟器崩溃,如果点击时处理所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复