关于需要设置的警报数量的困惑 [英] Confusion regarding number of alarms needed to be set
问题描述
我在 SqlLite
和 Postgresql
数据库中具有以下数据,并成功在 tablularlayout
基本上是大学生的时间表。
a http://www.4shared.com/download/1w7Tyicfce/random3.png
我确实为所有文本视图
分别设置了 OnClickListener
,这意味着每个主题名称
点击主题名称即 textview
,a页面显示如下。
a http://www.4shared.com/download/Ii8DtkvJba/setalarm.png
到目前为止,我已经编写了设置单个警报的代码仅但不是多个。因此选择一个 chec仅kbox
。但是,我要设置多个警报,以便如果一个警报对象同时选择了所有4个复选框
4个警报,则必须相应地触发。
问题
1。为每个主题分别设置警报时,我应该将4个待定意图
设置为4个复选框
的时间,并且仅触发在复选框中选择的那些警报
?我应该对 PendingIntent.getBroadcast
使用相同的 requestcode
吗? 4个不同的请求代码
?现在我只有1个 pendingintent
。当保存并设置警报
按钮被单击,根据选择的复选框
时间设置了一个警报。但是我认为这不是实现结果的正确方法。
2。我假设我必须为4个 pendingintents
创建4个 pending意图>
。对于DBMS,其星期一为1:40-3:20PM,因此对于DBMS,有4个待定意图
。现在,我总共需要创建个主题* 4
个待定意图
的数量,每个都有不同的请求代码
?
注意
由于我的问题不清楚,请在下面发表评论。
简单而简短的答案是所需的不同时隙的警报数量,相同数量需要创建待处理的意图。
I have the following data in SqlLite
as well as Postgresql
database and am successfully showing it in a tablularlayout
on my android widget.It's basically a timetable for college students.
a http://www.4shared.com/download/1w7Tyicfce/random3.png
I did set OnClickListener
for all the textviews
individually,which means each and every subject name which you're seeing is clickable in my app.
Upon clicking on a subject name i.e a textview
,a page shows up as following.
a http://www.4shared.com/download/Ii8DtkvJba/setalarm.png
Till now I have written code for setting up a single alarm only but not multiple.Hence selecting one checkbox
only.However i am gonna set multiple alarms such that if one selects all the 4 checkboxes
4 alarms for a single subject must be triggering accordingly.
Question
1.While setting alarms for each subject individually,should i set 4 pendingintents
for 4 checkbox
selected time and only trigger those alarms which are selected in checkboxes
?And should i use the same requestcode
for the PendingIntent.getBroadcast
or should i use 4 different requestcodes
?Right now i have only 1 pendingintent
.When save and set alarm
button is clicked one alarm is being set according to the selected checkbox
time.But i think this is not the right way for achieving the result.
2.I am assuming that i have to create 4 pendingintents
for "one subject at one particular slot,for eg. for DBMS its monday 1:40-3:20PM,so 4 pendingintents
for DBMS".Now in total do i need to create No. of subjects * 4
number of pendingintents
each having differentrequestcodes
?
Note
As it may be a little confusing please comment below if something is not clear in my question.
The simple and short answer is The number of alarms for different time slots needed,the same number of pendingintents are needed to be created.
这篇关于关于需要设置的警报数量的困惑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!