安卓 宽式图

                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);

效果

安卓 宽式图_第1张图片

你可能感兴趣的:(安卓 宽式图)