简体   繁体   English

Android:尝试切换活动时意外退出

[英]Android: Unexpectedly Quit When Trying to Switch Activity

I'm new to posting, but have been using the site for help for a while now. 我是新来的发布者,但是已经使用网站一段时间了。 So thanks for that! 因此,谢谢!

I'm working on a new app, got everything running well. 我正在开发一个新应用,一切运行正常。 It's a kids' soundboard. 这是孩子们的音板。 2 pages of imagebuttons in a relative layout, with onclick listeners which triggers SoundPool. 2页图像按钮的相对布局,带有onclick侦听器,可触发SoundPool。

My question is this: 我的问题是这样的:

in testing I've discovered if you're finger is anywhere on the screen where a button is not (say pressing on the background) and then you try to touch a button (multitouch) ... the button press doesn't register. 在测试中,我发现您的手指是否在屏幕上没有按钮的任何位置(例如,按背景),然后尝试触摸按钮(多点触摸)……按钮的按下未注册。 Any way to fix this? 有任何解决这个问题的方法吗?

Thanks! 谢谢!

You have to cover additional event types for multi-touch, if you are not covering below Actions, you are not covering multi-touch 您必须涵盖多点触控的其他事件类型,如果您未涵盖“操作”下方的内容,则不涵盖多点触控

MotionEvent.ACTION_POINTER_DOWN: This event happens for any additional finger that touches the screen after the first finger touches MotionEvent.ACTION_POINTER_DOWN:第一个手指触摸后,任何其他触摸屏幕的手指都会发生此事件

MotionEvent.ACTION_POINTER_UP :This gets fired when a finger is lifted up from the screen and more than one finger is touching the screen. MotionEvent.ACTION_POINTER_UP :当手指从屏幕上抬起并且多个手指触摸屏幕时,将触发此事件

The explanation is quite tedious. 解释很繁琐。 I suggest you to google multi-touch for android. 我建议您使用google multi-touch for android。 One helpful link is: http://android-developers.blogspot.in/2010/06/making-sense-of-multitouch.html 一个有用的链接是: http : //android-developers.blogspot.in/2010/06/making-sense-of-multitouch.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM