On Wed, Aug 3, 2011 at 3:12 AM, kirti waykole <[email protected]> wrote: > hello friends, > I am new in android . I want to design a Wake-up Alarm . In this i design > page in that we can set Alarm time and date. all data is sotred in database. > but when i set calender to particular date it wont work. Please help me i > don't understand where i am going wrong. ... > Calendar calendar = Calendar.getInstance(); > > > int month=calendar.get(Calendar.MONTH); > long firstTime =System.currentTimeMillis(); > int month1=month+1; > int date=calendar.get(Calendar.DATE); > int year=calendar.get(Calendar.YEAR); > full=month1+"/"+date+"/"+year; > > int h=calendar.get(Calendar.HOUR_OF_DAY); > int m=calendar.get(Calendar.MINUTE); > > > > calendar.set(Calendar.MONTH,8); > calendar.set(Calendar.DATE, 1); > calendar.set(Calendar.YEAR, 2011); > > calendar.set(Calendar.HOUR_OF_DAY, 18); > calendar.set(Calendar.MINUTE,18); > > calendar.set(Calendar.SECOND, 0); > > > alarmManager.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, > calendar.getTimeInMillis(), SystemClock.elapsedRealtime(), > pendingIntent);
ELAPSED_REALTIME_WAKEUP means that you are giving your "alarm time in SystemClock.elapsedRealtime() (time since boot, including sleep)". Since your triggerAtTime is coming from the calendar object, I think you want RTC_WAKEUP, no? You may also want to use set() rather than setRepeating(), but I'm not sure what you're really trying to do, so I can't say for sure. Jen -- You received this message because you are subscribed to the Google Groups "Android Discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/android-discuss?hl=en.
