 <p>I'm not sure how accurate will be.</p> <pre><code> @Override public boolean onTouchEvent(MotionEvent event) { Display display = getWindowManager().getDefaultDisplay(); DisplayMetrics mertrics = new DisplayMetrics (); display.getMetrics(metrics); float density = getResources().getDisplayMetrics().density; float dpHeight = metrics.heightPixels / density; float y = (float)event.getY(); switch (event.getAction()) { case MotionEvent.ACTION_MOVE: if(y &lt; dpHeight / 2 + 50 &amp;&amp; y &gt; dpHeight / 2 - 50){ //no hello() here } else { // call hello() here and remove it from layout } } return false; } </code></pre>