您好我想在我的Android应用中设计我的通知,以便在扩展通知时,内容标题部分应该像Inshorts一样隐藏。
现在我的代码是这样的:
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.push)
.setContentTitle(title)
.setSubText(messageDec)
.setAutoCancel(true)
.setSound(defaultSoundUri)
.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher_st))
.setContentIntent(pendingIntent);
//CUSTOM NOTI
if(!imageUrl.isEmpty()) {
NotificationCompat.BigPictureStyle s = new NotificationCompat.BigPictureStyle();
s.bigPicture(image);
notificationBuilder.setStyle(s);
}
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(requestCode, notificationBuilder.build());
任何人都可以提出解决方案。