i don't understand why are we using setId function in project "Alison" and what is setId using for.
can't we just write?
setId?? Can someone explail?
Post a Reply
|Oldest Newest Rating|
· July 24, 2015
usernameDetails.addRule takes in two integers. One integer is the rule itself (RelativeLayout.ABOVE) the other integer is the view what it has to be above. But the redButton is a Button object. That why you set a id for the button.
And when you want to add a new button to an existing Activity that is using xml you dont have a Button object in Java. The addRule function uses an integer as an input for the view so you can use an id that you specified in a xml file.
I hope I answered your question
· July 25, 2015
thank you. l think l understand now
· July 29, 2015
where can i find tutorial source code for any video pls
Java / Android Development
Very popular language used to create desktop applications, website applets, and Android apps.
|Bucky Roberts Administrator|