2012-05-08 10 views

答えて

1

最も簡単な方法は、それが私の作品に使用しWakeLock

PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); 
PowerManager.WakeLock wakeLock = pm.newWakeLock(
     pm.SCREEN_DIM_WAKE_LOCK, "My wakelook"); 
// This will make the screen and power stay on 
// This will release the wakelook after 1000 ms 
wakeLock.acquire(1000); 

// Alternative you can request and/or release the wakelook via: 
// wakeLock.acquire(); wakeLock.release(); 
1
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN | 
    WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, 
        WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); 

を使用することです!

関連する問題