how can I catch the event when click occurs somewhere on the app screen?
It doesn\'t matter if there is a button or something else. I just need to apply an onClick()>
If you want to know, that the user clicked anywhere on the screen then the trick is to override OnUserUnteraction():
"Called whenever a key, touch, or trackball event is dispatched to the activity.Implement this method if you wish to know that the user has interacted with the device in some way while your activity is running. This callback and {@link #onUserLeaveHint} are intended to help activities manage status bar notifications intelligently; specifically, for helping activities determine the proper time to cancel a notification...."
public abstract class BaseActivity extends Activity {
...
@Override
public void onUserInteraction() {
Log.d(DEBUG_TAG,"Touch anywhere happened");
super.onUserInteraction();
}
I am using it to set up app screen block after some inactivity.