For example i have view which have id :
<ImageButton
android:id="@+id/imageButtonStart"
android:layout_width="100dp"
android:layout_height="100dp" />
Does i need made private field with the same name, like this:
private ImageButton imageButtonStart;
Although it is good practice to keep things consistent and use the same name for your variable, you do not need to call your class variable the same as the id within your XML, as you’ll manually connect these up within your code such as:
My personal preference is use to the format
componentTypeDescriptiveNamesuch asimageButtonStartwithin the XML, but within code I prefer a more English driven approach, such asstartButton.Typically I end up with