디바이스의 스크린이 켜졌는지 확인하는 방법은 아래와 같다.
// check screen status
public static boolean isScreenOn(Context context) {
PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
return pm.isScreenOn();
}
public static boolean isScreenOn(Context context) {
PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
return pm.isScreenOn();
}
'Development & Tips > Android' 카테고리의 다른 글
| 강제로 Exception 던지기 (0) | 2011/11/14 |
|---|---|
| [TIP] Wake Lock 컨트롤 하는 방법 (0) | 2011/03/11 |
| [TIP] 스크린이 켜졌는지 확인하는 방법 (0) | 2011/03/11 |
| [TIP] Heap 사이즈 체크하기 (Java + Native) (0) | 2011/03/11 |
TAG Android