NotificationCompat.Builder builder = new NotificationCompat.Builder(MainActivity.this);
builder.setSmallIcon(R.mipmap.evaluate_yellow_face);
builder.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.evaluate_yellow_face));
builder.setContentTitle("这是一个通知");
builder.setContentText("这是我的大视图通知");
builder.setDefaults(Notification.DEFAULT_ALL);
NotificationCompat.InboxStyle style = new NotificationCompat.InboxStyle();
style.setBigContentTitle("通知");
style.addLine("第一是道胜");
style.addLine("第二是义胜");
style.addLine("第三是治胜");
style.addLine("第四是度胜");
style.addLine("第五是谋胜");
style.addLine("第六是德胜");
style.addLine("第七是仁胜");
style.addLine("第八是明胜");
style.addLine("第九是文胜");
style.addLine("第十是武胜");
style.setSummaryText("通知");
builder.setStyle(style);
Notification build = builder.build();
NotificationManager systemService = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
systemService.notify(0 * 2, build);
安卓 宽式图
最新推荐文章于 2022-10-04 23:46:16 发布