B3nedikt/AppLocale

NullPointerException: Android Marshamllow (API 23) attachBaseContext

kunal26das opened this issue · 3 comments

Getting Nullpointer exception on attachBaseContext in android marshmallow
@Override protected void attachBaseContext(Context newBase) { try { super.attachBaseContext(AppLocale.wrap(newBase)); } catch (NullPointerException e) { super.attachBaseContext(newBase); } }

@kunal26das I fixed this in AppLocale 2.0.3 just now :)

Thanks a lot for the update. I do have 1 question though, how do I make it compatible with a custom view inside of which there are TextViews. The text that needs to be set in those TextViews comes from custom attributes.

Your welcome :)
To do this you need to first create a custom View Transformer, have a look at this one for TextViews: TextViewViewTransformer
Then you can just set this new ViewTransformer on Reword in your application class like this:

Reword.addViewTransformer(yourCustomViewTransformer)