Android: How to remove old references in R.java?
I am new to Android and I don't know much about Android. Well I have created a layout named button-layout.xml and the very firstly I added a relative layout to and and named it too button-layout.
What happens is that it created R.java and crated a reference to my layout with name public static final int button-layout=0x7f060000; as you people know that you can not use - in your variable name as it is illegal.
Now I want to clean my R.java do any body knows solution of this problem?
Pasting my code below button-layout.xml
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/button-layout">
<LinearLayout android:id="@+id/button-layout"
android:layout_height="wrap_content" android:layout_width="fill_parent">
<TextView android:id="@+id/TextView01"
android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="First Name"></TextView>
开发者_如何转开发 <EditText android:id="@+id/EditText01"
android:layout_width="wrap_content" android:layout_height="wrap_content" android:width="100px"></EditText>
</LinearLayout>
<LinearLayout android:id="@+id/LinearLayout02"
android:layout_below="@id/LinearLayout01" android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView android:id="@+id/TextView02"
android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Last Name"></TextView>
<EditText android:id="@+id/EditText02"
android:layout_width="wrap_content" android:layout_height="wrap_content" android:width="100px"></EditText>
</LinearLayout>
<LinearLayout android:id="@+id/LinearLayout03"
android:layout_below="@id/LinearLayout02" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_centerInParent="true">
<Button android:id="@+id/Button01"
android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Submit"></Button>
</LinearLayout>
</RelativeLayout>
R.java
/* 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.geniteam.mytest;
public final class R {
public static final class attr {
}
public static final class color {
public static final int blue=0x7f050000;
}
public static final class drawable {
public static final int golden_gate=0x7f020000;
public static final int icon=0x7f020001;
}
public static final class id {
public static final int Button01=0x7f060008;
public static final int Button02=0x7f060010;
public static final int EditText01=0x7f060003;
public static final int EditText02=0x7f060006;
public static final int LinearLayout01=0x7f060001;
public static final int LinearLayout02=0x7f060004;
public static final int LinearLayout03=0x7f060007;
public static final int RelativeLayout01=0x7f06000e;
public static final int TextView01=0x7f060002;
public static final int TextView02=0x7f060005;
public static final int backbutton=0x7f060014;
public static final int btn_FNname=0x7f060011;
public static final int btn_cancel=0x7f06000c;
public static final int btn_shahzad=0x7f060012;
public static final int button-layout=0x7f060000; //here is error
public static final int editFirstName=0x7f060016;
public static final int editLastName=0x7f060017;
public static final int entry=0x7f06001a;
public static final int firstName=0x7f060015;
public static final int image=0x7f06000a;
public static final int label=0x7f060019;
public static final int lastName=0x7f060018;
public static final int layout_root=0x7f060009;
public static final int layout_shahzad=0x7f06000d;
public static final int ok=0x7f06001b;
public static final int relative_layout=0x7f060013;
public static final int text=0x7f06000b;
public static final int txt_label=0x7f06000f;
}
public static final class layout {
public static final int abc=0x7f030000;
public static final int custom_dialog=0x7f030001;
public static final int frame_layout=0x7f030002;
public static final int layout_shahzad=0x7f030003;
public static final int main=0x7f030004;
public static final int next_screen=0x7f030005;
public static final int relative_layout=0x7f030006;
public static final int relative_test_layout=0x7f030007;
}
public static final class string {
public static final int app_name=0x7f040000;
public static final int hello=0x7f040001;
public static final int hello_new=0x7f040002;
}
}
The R.java file is automatically generated by resource compiler (AAPT). So every time you make changes to your project, and save, the R.java file is rebuilt.
R.java is rebuilt again when you Build your project, incase it doesn't delete it and re-built....
精彩评论