[Android] Service 실행 여부 파악하기
안드로이드 서비스 동작 중인지 파악하기 아래의 코드를 사용하면 된다. 나는 보통 static으로 선언하여 service 안에 넣는다. 예를 들어 service 이름이 'JHService' 라면JHService.isServiceRunning(); 하면 여부가 나온다. public static boolean isServiceRunning(Context context) { ActivityManager am = (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE); for (RunningServiceInfo rsi : am.getRunningServices(Integer.MAX_VALUE)) { if ([서비스이름].class.getName()..
Development/Mobile
2015. 11. 29. 20:57
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- db
- winapi
- android
- driver
- kering
- Quiz
- 리눅스
- 드라이버
- MFC
- linux
- Python
- algorithm
- source
- API
- jni강좌
- 안드로이드
- jni
- java
- 프로그래밍
- 음악
- C
- gcc
- NDK
- AWS
- C++
- database
- Visual C++
- Troubleshooting
- it
- Cloud
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함