android - alarm takes n multiple times -
i trying make alarm application take ‘n’ number of times user , buzz @ times , stores difference in timing next user accesses application, stored difference default. here code of main activity:
public void startalert(view view) { edittext texth = (edittext) findviewbyid(r.id.hours); int h = integer.parseint(texth.gettext().tostring()); edittext textm = (edittext) findviewbyid(r.id.minutes); int m = integer.parseint(textm.gettext().tostring()); edittext texts = (edittext) findviewbyid(r.id.seconds); int s = integer.parseint(texts.gettext().tostring()); calendar cal = calendar.getinstance(); cal.set(calendar.hour, h); cal.set(calendar.minute, m); cal.set(calendar.second, s); intent intent = new intent(this, alarmservice.class); pendingintent pendingintent = pendingintent.getactivity(this, 12345, intent, pendingintent.flag_cancel_current); alarmmanager alarmmanager = (alarmmanager) getsystemservice(alarm_service); alarmmanager.set(alarmmanager.rtc_wakeup, cal.gettimeinmillis(), pendingintent); toast.maketext(this, "alarm set", toast.length_long).show(); }
i have no idea how add n number of edittexts
@ runtime? , alarmmanager
class...shall run loop creating n number of alarmmanager
objects?
get reference listview/layout in activity. can use layout.addview(edittext)
it pretty same add button layout programmatically
simon
Comments
Post a Comment