Đó gọi Expanded layouts mà có sẵn ngay từ phiên bản Jelly Bean.
Có 2 quan điểm của Thông báo:
- Normal View
- Big Xem
xem lớn của một thông báo chỉ xuất hiện khi thông báo được mở rộng, trong đó xảy ra khi thông báo là tại đầu ngăn thông báo hoặc khi người dùng mở rộng thông báo bằng cử chỉ. Thông báo mở rộng được giới thiệu lần đầu tiên trong Android 4.1 JellyBean [API 16].
Trong trường hợp của bạn, bạn chỉ muốn hiển thị hình ảnh lớn trong thông báo, cung cấp cho Notification.BigPictureStyle thử:
Bitmap remote_picture = null;
// Create the style object with BigPictureStyle subclass.
NotificationCompat.BigPictureStyle notiStyle = new
NotificationCompat.BigPictureStyle();
notiStyle.setBigContentTitle("Big Picture Expanded");
notiStyle.setSummaryText("Nice big picture.");
try {
remote_picture = BitmapFactory.decodeStream(
(InputStream) new URL(sample_url).getContent());
} catch (IOException e) {
e.printStackTrace();
}
// Add the big picture to the style.
notiStyle.bigPicture(remote_picture);
Nguồn
2014-04-16 06:10:51
Kiểm tra tại đây http://codeversed.com/expandable-notifications-android/ – upenpat