Hi All, I have an app which displays a notification from a service (and the service shows notification icon etc etc). The notification works fine till Android 4.3, I think it also works on 4.4 (not 100% sure). But it definitely does not work with 5.1.
This is the code I have at the moment (which is not working on Lolipop). private void displayNotification(){ String ns = Context.NOTIFICATION_SERVICE ; NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns); int icon = R.drawable.ns_small ; CharSequence ticketText = "Some Text"; long when = System.currentTimeMillis(); Notification notification = new Notification ( icon, ticketText, when ); notification.flags = Notification.FLAG_ONGOING_EVENT ; Context context = getApplicationContext() ; CharSequence contentTitle = "Some more text"; CharSequence contentText = "Again some more text"; Intent notificationIntent = new Intent (this, MainActivity.class); PendingIntent contentIntent = PendingIntent.getActivity (context, 0, notificationIntent, 0 ); notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent ); mNotificationManager.notify( NOTIFICATION_ID, notification ); } I tried to find out from documentation. I can see that notification API is changed in 5.0. Main question is, if I use the new API, will it work on earlier versions of Android ?? At this point in time, there are more Android 3.X and 4.X based devices than 5.X. So, I want to application to run across all these versions. How can I do that ? Thanks in advance. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.