What are "tag" and "id" on Layouts?

android, android-layout, android-logcat

Solution

Id is id of your xml's components [may be views like textview,edittext... or viewgroup like linearlayout ,relativelayout... or anything else] in xml simply you can get reference to them in java code by saying

(R.id."id of your view in xml")

but firstly you should use setContentView(R.layout."name of xml file in layout/res in your project") this xml file which you want to use it's components .

TAG i use it when i want to show message in logcat [tool in eclipse you can watch your app messages when it is running] by saying String TAG= yourclassname.class.getsimpleName();

and use it in Log.d(TAG,"any string here"+some variable in my class i want to know it's value in a particular time when app running );

i hope that i made it clear to you .

Problem

I know how the switch statement works but I don't know what this means (R.id.webbutton). Can anyone please explain what it is and also what is TAG? Is there any guide for the beginners? I mean absolute beginners.

Original source