安卓中更友好提示:toast、通知栏、对话框
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
public void notiMager(){
nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
//链式调用
Notification noti= new Notification.Builder(this)
.setContentTitle("我是大标题")
.setContentText("我是标题内容")
.setSmallIcon(R.drawable.ic_launcher_background)
.setLargeIcon(BitmapFactory.decodeResource(getResources(),R.drawable.ic_launcher_background))
.build();
nm.notify(10,noti);//发送一条通知
nm.cancel(10);//取消通知
}