使用库notifyme设置通知警报时唤醒设备

时间:2020-06-10 08:29:34

标签: android push-notification alarmmanager datetimepicker

我尝试制作一个简单的笔记应用程序,在其中添加了一个警报以记住已做的笔记,但是在此页面上,我使用notifyme库发出了通知警报,通知已成功出现,但确实通知出现时没有唤醒设备,解决方案是什么?我必须直接使用警报管理器还是只需要在此代码中添加一些内容?

@Override
public void onDateSet(DatePickerDialog view, int year, int monthOfYear, int dayOfMonth) {
    now.set(Calendar.YEAR,year);
    now.set(Calendar.MONTH,monthOfYear);
    now.set(Calendar.DAY_OF_MONTH,dayOfMonth);
    tpd.show(getSupportFragmentManager(),"Timepickerdialog");
}

@Override
public void onTimeSet(TimePickerDialog view, int hourOfDay, int minute, int second) {
    now.set(Calendar.HOUR_OF_DAY,hourOfDay);
    now.set(Calendar.MINUTE,minute);
    now.set(Calendar.SECOND,second);
    Intent intent = new Intent(getApplicationContext(),NoteActivity.class);
    NotifyMe notifyMe = new NotifyMe.Builder(getApplicationContext())
            .title("Aktifitas Anda : ")
            .content(edtTitle.getText().toString())
            .color(255,0,255,0)
            .led_color(0,255,255,0)
            .time(now)
            .addAction(new Intent(),"Snooze",false)
            .key("test")
            .addAction(new Intent(),"Dismiss",true,false)
            .addAction(new Intent(),"Done")
            .large_icon(R.drawable.ic_logobbq_round)
            .build();
}

链接:https://github.com/jakebonk/NotifyMe

0 个答案:

没有答案