04使用Notification在状态栏上显示通知  

Notification.Builder(context)已弃用Android O(Notification.Builder(context) deprecated Android O)

解决方案  :使用了if / else条件在Android O设备和其他设备之间隔离。  

Notification.Builder notificationBuilder ; 

if(Build.VERSION.SDK_INT> = Build.VERSION_CODES.O){
notificationBuilder = new Notification.Builder(mContext,
mContext.getResources()。getString( R.string.notification_id_channel));
} else {
notificationBuilder = new Notification.Builder(mContext);
}