
Listing 6. R.java file
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.msi.ibmtutorial;
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int icon=0x7f020000;
}
public static final class layout {
public static final int main=0x7f030000;
}
public static final class string {
public static final int app_name=0x7f040000;
}
}
The R class contains anonymous subclasses, which each contain identifiers for the
various resources previously described. Note that all of these classes are static.
Note the element represented by: R.layout.main. This identifier represents the layout
defined by main.xml. Recall that this value is used in the onCreate method of the
activity as follows: setContentView(R.layout.main);. This is the point at
which a specific activity (in this case, SayAnything) and a specific layout (main)
are bound together at runtime.
Building applications
Files are compiled every time they are saved by default.
Figure 5. Error pane
developerWorks® ibm.com/developerWorks
Develop Android applications with Eclipse
Page 18 of 35 © Copyright IBM Corporation 1994, 2008. All rights reserved.
Comentários a estes Manuais