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
    • 158
    Comment on it

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

    1. Uri notificationsound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
    2. String notificationText;
    3. NotificationManager mNotificationManager;
    4. int NOTIFICATION_ID;
    5.  
    6. notificationText = "This is the notification long message "+
    7. "that will cover more than two lines in the notification." +
    8. "This is just the part of our example " ;
    9.  
    10. NOTIFICATION_ID = (int) (System.currentTimeMillis());
    11.  
    12. mNotificationManager = (NotificationManager)
    13. this.getSystemService(Context.NOTIFICATION_SERVICE);
    14.  
    15. final Notification.Builder builder = new Notification.Builder(this);
    16. builder.setStyle(new Notification.BigTextStyle(builder)
    17. .bigText(notificationText)
    18. .setBigContentTitle("NotificationTitle")
    19. .setSummaryText("Big summary"))
    20. .setContentTitle("Title")
    21. .setContentText("Hello this is the context text")
    22. .setSmallIcon(R.drawable.logo);
    23.  
    24. mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Reset Password
Fill out the form below and reset your password: