마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

복수 알람 설정이 안됩니다!~

0 추천
int f;
        for(f=0;f<10;f++){
            calendar[f] = Calendar.getInstance();
            calendar[f].setTimeInMillis(System.currentTimeMillis());
            calendar[f].set(Calendar.MINUTE, calendar[f].get(Calendar.MINUTE) + 1);
            calendar[f].set(Calendar.SECOND, f * 5);

            Intent intent = new Intent(this, AlarmReceiver.class);
            pi=PendingIntent.getBroadcast(this, f,intent, 0);
            alarmManager[f] = (AlarmManager) getSystemService(ALARM_SERVICE);
            alarmManager[f].set(AlarmManager.RTC_WAKEUP, calendar[f].getTimeInMillis(), pi);
            intentArray.add(pi);
        }

pi하고 alarmManager는 전역변수 설정해서 넣었습니다 이게 웃긴게 (설정 분 +1)의 1초부터 시작해서 5초마다 10번을 지정하려 했는데 뭐가 이상한지 35,40,45초에만 울립니다...도와주세요 도움이 절실히 필요합니다,,,,
빨간늑돌이 (160 포인트) 님이 2015년 9월 25일 질문

1개의 답변

0 추천

자답....set은 정확도가 낮아서 안되고 setExat()로하니 잘되네여...이걸 일주일을 했는데...ㅠ.ㅠ

빨간늑돌이 (160 포인트) 님이 2015년 9월 25일 답변
...