Android PowerManager wakelock wont work withouth TOAST
<p>I have made an app that wakes up the screen when it receives a text message. I came up with the following code to wake the screen.</p>

<pre><code>PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);

        boolean isScreenOn = pm.isScreenOn();

    if(!isScreenOn ){

final PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "My tag");
        wl.acquire();

        Toast.makeText(getBaseContext(), "This is WAKEUP SCREEN", Toast.LENGTH_SHORT).show();
        Thread timer = new Thread(){
            public void run(){
                try {
                    sleep(5000);
                } catch (InterruptedException e) {
                    // TODO: handle exception
                }finally{
                    wl.release();
                }
            }
        };
        timer.start();
    }
</code></pre>

<p>Now the problem is that if I comment out or remove the statement <code>Toast.makeText(getBaseContext(), "This is WAKEUP SCREEN", Toast.LENGTH_SHORT).show();</code> my screen wont wakeup. I am not sure what is the problem here... and I am using android 2.3.</p>
