understanding IDs

Views may have an integer id associated with them. These ids are typically assigned in the layout XML files, and are used to find specific views within the view tree. A common pattern is to:


<Button id="@+id/my_button"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:text="@string/my_button_text"/>

Button myButton = (Button) findViewById(R.id.my_button);

View IDs need not be unique throughout the tree, but it is good practice to ensure that they are at least unique within the part of the tree you are searching.

Learn more about views

You have to understand resources

For the id attribute of a tag in XML, you should use a special syntax: "@+id/somestringvalue". The "@+" syntax creates a resource number in the R.id class, if one doesn't exist, or uses it, if it does exist. When declaring an ID value for an XML tag, use this syntax. Example: <TextView id="@+id/nameTextbox"/>, and refer to it this way in Java: findViewById(R.id.nameTextbox).

The above taken from this link

Here are a list files

Search for: android xml attribute package resource syntax

Search for: More on android xml syntax

More on android xml syntax

weblog of RustyHarold and DianneHackman on xml syntax for android

Dianne Hackborn of Android: Blog

android resource references what are

Search for: android resource references what are

what are resource references


package com.ai.android.helloworld;

public final class R {
    public static final class attr {
    }
    public static final class drawable {
        public static final int icon=0x7f020000;
    }
    public static final class id {
        public static final int b1=0x7f050001;
        public static final int text1=0x7f050000;
    }
    public static final class layout {
        public static final int main=0x7f030000;
    }
    public static final class string {
	
        public static final int app_name=0x7f040001;
        public static final int app_name1=0x7f040003;
		
        public static final int hello=0x7f040000;
        public static final int hello1=0x7f040002;
    }
}

Predefined constants in android.R

How to use Listview anddev.org

android pre-defined resource id layout use

Search for: android pre-defined resource id layout use