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
Start with the tutorials. (If you are so absolutely a beginner that you don't have a development environment set up yet, then start with Installing the SDK.)
When you use the console log facility in Android, the first argument to the logging methods is a tag, which can be used to filter logcat output. A typical programming style is:
public class Something {
private static final String TAG = "Something";
public void aMethod() {
Log.i(TAG, "Entered aMethod");
}
. . .
}
That's what TAG is.
Resource IDs are explained in the tutorial. When you define a resource in XML, Android generates a class called R
with nested classes for different kinds of resources (R.id
, R.string
, R.layout
, etc.). Each of those nested classes has a constant for each resource of that type. R.id.webbutton
might be generated from a layout file that has a button with attribute android:id="@+id/webbutton"
. This is all explained in the tutorials.