After a new update, I've discovered an issue with the compatibility of spannable/formatted strings in action bars and LG devices.
Here's my code before:
SpannableString s = new SpannableString("About");
s.setSpan(new TypefaceSpan(this, "Sansation-Regular.ttf"), 0, s.length(),Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
getSupportActionBar().setTitle(s);
I believe on setTitle is when it crashes and gives this error:
java.lang.IllegalArgumentException: Invalid payload item type at android.util.EventLog.writeEvent(Native Method)
Would this fix any potential issues? I'm new to Android so wouldn't know. Because the issue seems to only happen with LG devices running 4.1.2 using actionbarcompat - but because I plan to add in support for lower API levels in the future, I don't really want to get rid of actionbarcompat for now.
SpannableString s = new SpannableString("About");
s.setSpan(new TypefaceSpan(this, "Sansation-Regular.ttf"), 0, s.length(),Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
try{
getSupportActionBar().setTitle(s);
}catch(IllegalArgumentException e) {
getSupportActionBar().setTitle("About");
}
Thanks.!
PS: Device in question is LG's running 4.1.2