Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to apply Big View Style in notification in android

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 143
    Comment on it

    If you are looking to apply the big view style to a notification, here is the solution you are looking for:-

    Uri notificationsound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
    String notificationText;
    NotificationManager mNotificationManager;
    int  NOTIFICATION_ID;
    
    notificationText = "This is the notification long message "+
                       "that will cover more than two lines in the notification." +
                       "This is just the part of our example " ;
    
    NOTIFICATION_ID = (int) (System.currentTimeMillis());
    
    mNotificationManager = (NotificationManager)
                    this.getSystemService(Context.NOTIFICATION_SERVICE);
    
    final Notification.Builder builder = new Notification.Builder(this);
    builder.setStyle(new Notification.BigTextStyle(builder)
                .bigText(notificationText)
                .setBigContentTitle("NotificationTitle")
                .setSummaryText("Big summary"))
                .setContentTitle("Title")
                .setContentText("Hello this is the context text")
                .setSmallIcon(R.drawable.logo);
    
    mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: