通知代码:
NotificationCompat.Builder noti = new NotificationCompat.Builder(context)
.setSmallIcon(R.drawable.work_alarm_icon)
.setContentTitle("Alarm")
.setContentText(w.toString())
.setContentIntent(pintent)
.setSound(Uri.parse("android.resource://com.google.app.workalarm/" + R.raw.alarm))
.setStyle(new NotificationCompat.BigTextStyle().bigText("..."));
noti.build().flags |= Notification.FLAG_INSISTENT;
noti.setLights(Color.WHITE, 1000, 500);
noti.setVibrate(new long[]{0,500,250,500});
我想听声音/振动并引导直到我取消它。(当我在新活动中单击“取消”按钮时)。帮我 !谢谢 !