Wait, I'm confused at what is happening here.  It looks like you're calculating something about the touch event, and then based on that you are sending back an intent to the main activity.  Why are you doing that?  Also, if you're just setting the result with an Intent, you don't need to specify a class.