I understand that the R.java file is important for mostly a lot of functions in android. So I learned that the way to gte around this is to Clean your project after creating a new android application project. But after a few cleans and you have a lot of code, the R.java file disappears and you are left with an error-ridden MainActivity.java file!
I HAVE NO ERROR IN MY XML FILES. And that is why I am really confused. The only error in my package/project folder is in the MainActivity.java
Any ideas how to get around this?
I am using Eclipse for making Android Applications, but more stable IDE suggestions for creating android applications would also be appreciated!
Here is my xml file:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/Quote"
/>
<EditText
android:id="@+id/Quote"
android:inputType="text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<Button
android:id="@+id/go"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/press"
/>
<Button
android:id="@+id/genRan"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/genRan"
/>
</LinearLayout>
Build your project , R.java will be regenerated, If its still not generated, Clean project and check your XML files and code thoroughly if there is any error in resource xml files R.java will not be generated.
Also check that have you import packagename.R in your imports or not?