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

Rendering problem with custom views #10

Closed
3mph4515 opened this issue Oct 19, 2014 · 1 comment
Closed

Rendering problem with custom views #10

3mph4515 opened this issue Oct 19, 2014 · 1 comment

Comments

@3mph4515
Copy link

With the last SDK update custom views render is broken:

The following classes could not be instantiated:
- app.philm.in.view.FontTextView (Open Class, Show Exception)
- app.philm.in.view.BackdropImageView (Open Class, Show Exception)
Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in
the IDE Exception Details java.lang.ClassCastException:
com.android.layoutlib.bridge.android.BridgeContext cannot be cast to app.philm.in.PhilmApplication  at app.philm.in.PhilmApplication.from(PhilmApplication.java:39)   at app.philm.in.view.FontTextView.(FontTextView.java:53)   at app.philm.in.view.FontTextView.(FontTextView.java:47)   at java.lang.reflect.Constructor.newInstance(Constructor.java:408)   at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:755)   at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)   at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)   at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:116)   at android.view.LayoutInflater.parseInclude(LayoutInflater.java:782)   at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:745)   at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)   at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)   at android.view.LayoutInflater.inflate(LayoutInflater.java:492)   at android.view.LayoutInflater.inflate(LayoutInflater.java:373)

How to fix it?

@3mph4515
Copy link
Author

Fixed with new right isInEditMode usage

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

1 participant