1.消息提醒功能:
public class NotifyTest {
public static final int ID=1;
private List<Homework>list;
private Context context;
private HomeworkDto dto;
public NotifyTest(Context context,List<Homework> list) {
super();
this.list = list;
this.context=context;
}
public void addNotificaction() {
NotificationManager manager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
// 创建一个Notification
Notification notification = new Notification();
notification.icon = R.drawable.notify;// 设置显示在手机最上边的状态栏的图标
notification.tickerText = "亲,你有信息啦~~~"; // 当前的notification被放到状态栏上的时候,提示内容
notification.defaults=Notification.DEFAULT_SOUND;// 添加声音提示
notification.audioStreamType= android.media.AudioManager.ADJUST_LOWER;//audioStreamType的值必须AudioManager中的值,代表着响铃的模式