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

Pass layout in activity constructor #14

Open
1 of 2 tasks
DatL4g opened this issue Jan 29, 2022 · 3 comments · May be fixed by #19
Open
1 of 2 tasks

Pass layout in activity constructor #14

DatL4g opened this issue Jan 29, 2022 · 3 comments · May be fixed by #19

Comments

@DatL4g
Copy link

DatL4g commented Jan 29, 2022

⚠️ Is your feature request related to a problem? Please describe

I'm normally using a viewbinding library to simplify the process and prevent memory leaks.
ViewBindingPropertyDelegate

The library wants me to pass the layout in the activity constructor as described in the README.
This makes it impossible to use with this Theme-Manager.

💡 Describe the solution you'd like

It would be nice if this library were compatible with ViewBindingPropertyDelegate and the best option for this would be if it's possible to pass the layout in the constructor.

🤚 Do you want to develop this feature yourself?

  • Yes
  • No
@DatL4g
Copy link
Author

DatL4g commented Apr 13, 2022

As a workaround the noreflection version can be used with CreateMethod.INFLATE

@DatL4g DatL4g linked a pull request Apr 14, 2022 that will close this issue
6 tasks
@krutzzz
Copy link

krutzzz commented Aug 24, 2022

So, basically, you didn't fix anything. Correct? I just encountered the same problem. I receive this exception:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.samprojre/com.example.samprojre.screens.main.MainActivity}: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.

@DatL4g
Copy link
Author

DatL4g commented Aug 25, 2022

@krutzzz
I fixed a bunch of things but it's already 7months ago and I don't know what in detail.

All I know is that in my fork (available on jitpack) it's possible to use the Fragment constructor.

And the activity constructor can't be used however it's possible to use the inflate create method with that it works

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

Successfully merging a pull request may close this issue.

2 participants