I have just started using android, and have about 5 layout files finished. However, I just realized that I have been using @id and @+id interchangeably, but I’m not sure what the exact difference between the two are.
I have just started using android, and have about 5 layout files finished. However,
Share
You need to use
@+idwhen you are defining your own Id for a View.Exactly from docs:
Here is a practical example:
So here, you created two
IDs, start and check. Then, in your application you are able to connect to them withfindViewById(R.id.start).And this
android:layout_below="@id/start"refer to existingid.startand means that yourButtonwith id check will be positioned belowButtonwith id start.