kandi X-RAY | linkui Summary
kandi X-RAY | linkui Summary
linkui
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of linkui
linkui Key Features
linkui Examples and Code Snippets
Community Discussions
Trending Discussions on linkui
QUESTION
What I have tried? I created a manifestUI() method and initialised all UI components and its working well. But I want to put the code for declaring and creating (as well as linking) UI to java code to a separate class, UICreation.java file. I copied all my code in the latter file and corrected small errors due to the code migration but it's not working out.
Objective: Keep the MainActivity.class lean and clean.
Do you think this will make the App function any quicker, slower or no effect whatsoever?
What I am trying to achieve, in a snapshot
Using UICreation class in MainActivity.java (I suspect I am doing something wrong here perhaps)
...ANSWER
Answered 2020-May-31 at 07:41Not sure why you would do this but in android development, views are only avaialable starting from onCreate(). In the first image/doddle you got that right and called manifsetUI() method in onCreate(). Moving the code to another class is where you went wrong, It's a bad idea.
If you want to remove the hassle of instantiating views, there are several ways to do that now, for example you can get direct access using things like Kotlin Synthetics if you were using Kotlin or viewBinding which is also available for Java
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install linkui
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page