通知栏Notification基本使用

来源:互联网 发布:arduino 单片机 区别 编辑:程序博客网 时间:2024/06/11 00:39
   NotificationManager manager= (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);                Notification notification=new NotificationCompat.Builder(MainActivity.this)                        .setContentTitle("标题")//标题                        .setContentText("内容")//内容                        .setSmallIcon(R.mipmap.ic_launcher)//图标                        .build();                manager.notify(1,notification);

原创粉丝点击