通知栏点击OPPO Find7上不起作用,在模拟器中可以跳转界面,Builder在2.3系统上找不到类
private void sendNotification(){
Intent intent = new Intent(getApplicationContext(),
AlarmlistActivity.class);
PendingIntent pendIntent = PendingIntent.getActivity(
getApplicationContext(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
Notification mNotification = getMessageNotification(msg.getTitle(),msg.getContext(),pendIntent);
messageNotificatioManager.notify(messageNotificationId, mNotification);
}
@SuppressLint("NewApi")
private Notification getMessageNotification(String title,String content,PendingIntent intent) {
Notification messageNotification = new Notification(R.drawable.androidicon,title,System.currentTimeMillis());
messageNotification.flags |= Notification.FLAG_AUTO_CANCEL;
messageNotification.flags |= Notification.FLAG_ONGOING_EVENT;
messageNotification.defaults |= Notification.DEFAULT_ALL;
messageNotification.setLatestEventInfo(getApplicationContext(), title, content, intent);
return messageNotification;
}