Chimu
Chimu

Reputation: 758

How to Implement inbox style and bigtext style notifications in android 2.2 version?

As Notification.Compact is part of android support library, they should be supported on android 4.0 and below, but I'm not able to see inbox style notification in android 4.0 as well. It works perfectly on android 4.2.

Upvotes: 1

Views: 912

Answers (1)

droid Learner
droid Learner

Reputation: 48

Handling compatibility

Not all notification features are available for a particular version, even though the methods to set them are in the support library class NotificationCompat.Builder. For example, action buttons, which depend on expanded notifications, only appear on Android 4.1 and higher, because expanded notifications themselves are only available on Android 4.1 and higher.

To ensure the best compatibility, create notifications with NotificationCompat and its subclasses, particularly NotificationCompat.Builder. In addition, follow this process when you implement a notification:

  1. Provide all of the notification's functionality to all users, regardless of the version they're using. To do this, verify that all of the functionality is available from an Activity in your app. You may want to add a new Activity to do this. For example, if you want to use addAction() to provide a control that stops and starts media playback, first implement this control in an Activity in your app.

  2. Ensure that all users can get to the functionality in the Activity, by having it start when users click the notification. To do this, create a PendingIntent for the Activity. Call setContentIntent() to add the PendingIntent to the notification.

  3. Now add the expanded notification features you want to use to the notification. Remember that any functionality you add also has to be available in the Activity that starts when users click the notification.

refer to this Link

Upvotes: 1

Related Questions