Ranter
Join devRant
Do all the things like
				++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
				Sign Up
			Pipeless API
 
				From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
				Learn More
			Comments
		
- 
				
				 tim636373128yAcessing the UI elements with "findById(R.id.xyzview)" is the way to go. You should do that once in onCreate() (Activity) or in onViewCreated() (Fragment) and store the reference in a global variable. tim636373128yAcessing the UI elements with "findById(R.id.xyzview)" is the way to go. You should do that once in onCreate() (Activity) or in onViewCreated() (Fragment) and store the reference in a global variable.
 There is no such thing as databinding in Android.
- 
				
				There is databinding. I personally haven't used it but have read a few things about it. https://developer.android.com/topic...
- 
				
				 tim636373128y@discosama tim636373128y@discosama
 I did not know about this. And I have never seen it being used in any project.
 Sounds interesting. I will have a look :)
- 
				
				 m4lik688y@tim636373 Once I have learned about it I got used to use databinding. And if you haven't tried it yet, you should give Jake warthon's butter knife a try (@DavidINC you too). Its a view injection library. :) m4lik688y@tim636373 Once I have learned about it I got used to use databinding. And if you haven't tried it yet, you should give Jake warthon's butter knife a try (@DavidINC you too). Its a view injection library. :)
- 
				
				Or if you use Kotlin, look at the Android Extensions. Big fan, of referencing the views using their ID straight in my Kotlin files. But make sure you have some sort of naming conventions for the views
Related Rants






 Only android developers will get it.
Only android developers will get it.
 Android studio gradle takes so much time to build. I decided to draw something to kill time whenever it build....
Android studio gradle takes so much time to build. I decided to draw something to kill time whenever it build....
 I finally built a new PC with 8GB memory, i7 4790K and SSD for OS. 
My old system was a core2duo with 2GB mem...
I finally built a new PC with 8GB memory, i7 4790K and SSD for OS. 
My old system was a core2duo with 2GB mem...
Quick question on Android development. Is it good practice to access UI elements from code, i.e R.id.example? Or is there something similar to WPF's data binding?
question
xml
android development
data binding