通知欄點(diǎn)擊OPPO Find7上不起作用,在模擬器中可以跳轉(zhuǎn)界面,Builder在2.3系統(tǒng)上找不到類
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;
}