I try to create a custom notification but getting the following exception:
FATAL EXCEPTION: main
android.app.RemoteServiceException: Bad notification posted from
For me, it was because I was setting the text inside the remoteViews TextViews incorrectly. I was doing this:
remoteViews.setString(R.id.txt, "setText", "text");
Using one of these methods solved it for me:
remoteViews.setCharSequence(R.id.txt, "setText", "text");
//Or simply:
remoteViews.setTextViewText(R.id.txt, "text");