tags:

views:

17

answers:

1

Hi,

In android phone app, I use touch screen to dial a number. And then I place the phone next to my ear for the phone call. And android will show 'Double Tab to unlock' on screen to disable anything activated/touched.

Can you please tell me how can I do that in my own application?

Thank you.

A: 

Set a timer and if there has been no activity for a certain period of time throw a view up over your UI and have it listen for a double tap. Once it registers a double tap have it go away.

CaseyB
but how can i swallow (i.e. not doing anything) for all other events?
michael
Have a look at the documentation http://developer.android.com/intl/fr/reference/android/view/View.html#onTouchEvent(android.view.MotionEvent)It says "Returns True if the event was handled, false otherwise." So just override this and return true so the events don't propagate to any other views.
CaseyB