通知扩展时隐藏内容标题

时间:2016-11-03 11:04:14

标签: android push-notification custom-view

您好我想在我的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());

任何人都可以提出解决方案。

0 个答案:

没有答案