R.java ファイルは、ほとんどの場合、Android の多くの機能にとって重要であることを理解しています。だから私は、これを回避する方法は、新しいAndroidアプリケーションプロジェクトを作成した後にプロジェクトをクリーンアップすることであることを学びました. しかし、数回クリーンアップすると、コードが大量になり、R.java ファイルが消えて、エラーが発生したファイルが残りMainActivity.java
ます。
XML ファイルにエラーはありません。そしてそれが私が本当に混乱している理由です。私のパッケージ/プロジェクトフォルダーの唯一のエラーはMainActivity.java
これを回避する方法はありますか?
私は Android アプリケーションを作成するために Eclipse を使用していますが、Android アプリケーションを作成するためのより安定した IDE の提案も歓迎します!
ここに私のxmlファイルがあります:
<?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>