working on mobile but exception on emulater
<p>I Created a code that works well on mobile, but it forces to stop on emulator. The code is to handle swipe up,down.
here is my code:</p>

<pre><code>horiz.setOnTouchListener(new OnSwipeTouchListener() 
        {
            public void onSwipeTop() 
            {
                Toast.makeText(ArtLauncher.this, "top", Toast.LENGTH_SHORT).show();
            }
            public void onSwipeBottom() 
            {
                Object sbservice = getSystemService( "statusbar" );
                Class&lt;?&gt; statusbarManager;
                try 
                {
                    statusbarManager = Class.forName( "android.app.StatusBarManager" );
                    Method showsb = statusbarManager.getMethod("expand" );
                    showsb.invoke( sbservice );
                } 
                catch (Exception e) 
                {
                    e.printStackTrace();
                }
            }
        });
</code></pre>

<p>and the class OnSwipeTouchListener is :</p>

<pre><code>class OnSwipeTouchListener implements OnTouchListener 
{
    @SuppressWarnings("deprecation")
    private final GestureDetector gestureDetector = new GestureDetector(new GestureListener());

    public boolean onTouch(final View v, final MotionEvent event) 
    {
        return gestureDetector.onTouchEvent(event);
    }

    private final class GestureListener extends SimpleOnGestureListener implements OnGestureListener 
    {
        private static final int SWIPE_THRESHOLD = 50;
        private static final int SWIPE_VELOCITY_THRESHOLD = 50;
        @Override
        public boolean onDown(MotionEvent e)
        {
            return true;
        }
        @Override
        public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) 
        {
            boolean result = false;
            try
            {
                float diffY = e2.getY() - e1.getY();
                    if (Math.abs(diffY) &gt; SWIPE_THRESHOLD &amp;&amp; Math.abs(velocityY) &gt; SWIPE_VELOCITY_THRESHOLD) {
                        if (diffY &gt; 0) 
                        {
                            onSwipeBottom();
                        } else 
                        {
                            onSwipeTop();
                        }
                    }

            } catch (Exception exception) 
            {
                exception.printStackTrace();
            }
            return result;
        }
        @Override
        public void onLongPress(MotionEvent arg0) 
        {   
            Toast.makeText(ArtLauncher.instance, "HELLO WORLD", Toast.LENGTH_LONG).show();
        }
        @Override
        public boolean onScroll(MotionEvent arg0, MotionEvent arg1, float arg2,
                float arg3) 
        {
            return false;
        }
        @Override
        public void onShowPress(MotionEvent arg0) 
        {
            //Toast.makeText(ArtLauncher.instance, "hhhhhhhhhhhhhh", Toast.LENGTH_LONG).show();
        }
        @Override
        public boolean onSingleTapUp(MotionEvent arg0) 
        {
            return false;
        }
    }
    public void onSwipeTop() 
    {
    }

    public void onSwipeBottom() 
    {
    }
}
</code></pre>

<p>anyone has any idea why my application stops and gives IllegalArgumentsException?</p>
