Comments (4)
On looking further into this, I released this is happening because the createBinding() {}
which is annotated with @OnLifecycleEvent(Lifecycle.Event.ON_CREATE)
in ActivityViewBindingDelegate
is called after onCreate() in the activity is done executing.
So everything in onCreate() which expects the views to be already on the screen and rendered are not present at all. Seems like this is how lifecycle observer is supposed to work. So this way of view-binding wont work for me. setContentView needs to be called after super.onCreate and not somewhere after or in the middle of onCreate() execution.
Is there someway this can be done?
from kahelpers.
There are few options you can use here.
- Move your logic in onPostCreate (i think you didn't read the updated article i made an issue the first time i published it, instead of onCreate i was supposed to use onPostCreate)
- use by viewBinder() and manually set the setContentView like you do
from kahelpers.
Take a look in the updated README
from kahelpers.
Option 1 is good. I'd forgotten about onPostCreate. But I'm gonna go with option 2 for now as it'll need minimum changes. Thanks.
from kahelpers.
Related Issues (20)
- Incomplete checks for permission-related API setRequireOriginal HOT 3
- Feature Request: Implement Duration.toXyzPart HOT 1
- Bad decryptAES / encryptAES method implementation.
- Useless reflection extension method
- Wrong function name context
- containsLetters does not support languages except english
- Over engineering by using regex when checking on number containing
- Useless functions removeFirstChar and removeLastChar. HOT 1
- isPhone extension implementation is strongly incorrect. HOT 1
- Incorrect implementation of email validation extension HOT 2
- Using regex for checking string is number, its overengineering HOT 1
- equalsIgnoreCase is redundant extension function, kotlin has the same.
- Side effects in String.normailze function.
- If you're moving classes to different package, please write in release notes as "Breaking Changes" HOT 1
- fix inspection warnings HOT 1
- integration dokka HOT 1
- Imported library includes unstable androidx deps HOT 2
- remove all @Nullable annotation HOT 5
- viewBinding issue HOT 10
- dokka multimodule
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kahelpers.