목록2018/11/16 (1)
낭만 프로그래머
Android 에서 JobIntentService를 사용하여 Background 작업하기
서비스를 이용하여 Widget을 업데이트 하는 기능을 개발하였다. 하지만 API 26 이상으로 compileSdkVersion 과 targetSdkVersion을 26 으로 올리고 난 이후 부터 java.lang.IllegalStateException 가 발생하기 시작해서 JobIntentService 를 사용해서 Background 작업 하는 것으로 수정 하였다 1. JobIntentService를 상속하여 Service 파일 생성 public class Update2x3Service extends JobIntentService { static final int JOB_ID = 1001; static void enqueueWork(Context context, Intent work) { enqueueW..
Android
2018. 11. 16. 12:19