1. 添加权限

  <uses-permission android:name="android.permission.WAKE_LOCK" />

2. 在Activity中添加代码

public class Desktop extends Activity {

    WakeLock wakelock;

    @Override
    protected void onResume() {

        // 让屏幕一直亮着

        wakelock = ((PowerManager) getSystemService(POWER_SERVICE))
                .newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK
                        | PowerManager.ON_AFTER_RELEASE, "Desktop");
        wakelock.acquire();
        // TODO Auto-generated method stub
        super.onResume();
    }

    @Override
    protected void onPause() {
        // TODO Auto-generated method stub

        if (wakelock != null) {

            wakelock.release();

        }
        super.onPause();
    }

}

3. Ok, 一直结束..