How to fix: android.app.RemoteServiceException: Bad notification posted from package *: Couldn't create icon: StatusBarIcon
What was happening was, I was including the integer reference to the icon in the PendingIntent bundle, and that integer was later being referenced while being posted to the NotificationManager.
In between getting the integer reference and the pending intent going off, the app was updated and all of the drawable references changed. The integer that used to reference the correct drawable now referenced either the incorrect drawable or none at all (none at all - causing this crash)
android.app.RemoteServiceException: Bad notification posted from package
I would suggest remove all the background ripple and foreground ripples from the layout and to keep the ripple in the notification.
In your notifications layout.
<ImageButton
android:id="@+id/notification_base_previous"
style="@style/NotificationAction.Previous"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
Now declare the style in the manifest.
This is for your individual buttons.
<style name="NotificationAction.Previous" parent="@style/NotificationAction">
<item name="android:src">@drawable/btn_playback_previous_light</item>
</style>
This should be the parent of style.
<style name="NotificationAction">
<item name="android:layout_width">@dimen/notification_action_width</item>
<item name="android:layout_height">@dimen/notification_action_height</item>
<item name="android:gravity">center|right</item>
<item name="android:scaleType">fitCenter</item>
<item name="android:padding">@dimen/notification_action_padding</item>
<item name="android:background">?android:selectableItemBackground</item>
</style>
It works this all the devices I have used so far. Please have a look.
Related Topics
Why I'm Getting Duplicate Class When Running My Android Project
Get Text from Web Page to String
Actionbaractivity Is Deprecated
Emulate Mifare Card with Android 4.4
Build and Install Unsigned APK on Device Without the Development Server
HTML List Tag Not Working in Android Textview. What How to Do
How to Disable the Clear Data Button in Application Info of Manage Application
Alphabetindexer with Custom Adapter Managed by Loadermanager
Change the Color of a Checked Menu Item in a Navigation Drawer
How to Change Package Name of Android Project in Eclipse
No Generated R.Java File in My Project
How to Autoplay HTML5 Mp4 Video on Android
Facebook Key Hash Does Not Match Any Stored Key Hashes
Sharing Data Between Fragments Using New Architecture Component Viewmodel
How to Create Edittext with Rounded Corners
How to Do Http Authentication in Android