Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException: Android Marshamllow (API 23) attachBaseContext #21

Closed
kunal26das opened this issue Sep 15, 2020 · 3 comments
Closed

Comments

@kunal26das
Copy link

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); } }

@B3nedikt
Copy link
Owner

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

@kunal26das
Copy link
Author

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.

@B3nedikt
Copy link
Owner

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants