Search code examples
androidnotificationsandroid-4.2-jelly-beansmartphone

Is it possible to support Android Pre-JellyBean and Post-JellyBean Notifications?


Is it possible to do something like this?:

not = AndroidCheck.isJellyBeanOrLater() ? notB.build() 
                        : notB.getNotification();

this turn out error on .build() because it is a JellyBean(API16) and later method and .getNotification() is a early to JellyBean method.

API MinVersion=10 Version=17

the objective is: the android version is early to JellyBean it uses .getNotification() deprecated method, if not it uses the actual .build() method.

Can you please try to help me? =)

thks


Solution

  • You can use NotificationCompat.Build from the Support Library to create Notifications that work on all platform levels.