W tym pliku są moje layouty następujące błędy wyświetlania w tym kodzieBłąd: Brak zasobów okazało się, że pasuje do podanej nazwie
error: Error: No resource found that matches the given name (at 'id' with value '@id/question_text_view').
error: Error: No resource found that matches the given name (at 'id' with value '@id/next_button').
jest to plik układ
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:id="@id/question_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="24dp"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal" >
<Button
android:id="@+id/true_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/true_button"
/>
<Button
android:id="@+id/false_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/false_button"
/>
</LinearLayout>
<Button
android:id="@id/next_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/next_button"
/>
</LinearLayout>
To jest moje struny. xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">GeoQuiz</string>
<string name="true_button">True</string>
<string name="false_button">False</string>
<string name="correct_toast">Correct</string>
<string name="next_button">Next</string>
<string name="incorrect_toast">Incorrect</string>
<string name="action_settings">Settings</string>
<string name="question_founder">Frank Reed Horton Founded APO on december 25 1947</string>
<string name="question_chief">Willy Wonka was known as a cheif</string>
<string name="question_lady">The first lady that became president in APO was Mary Katz</string>
<string name="question_president">Our current President of the Delta Rho chapter is john dolan</string>
<string name="question_alphabets">Alpha, Beta, Gamma, Delta, Epsilon, Eta, Zeta</string>
</resources>
wiem, że tam jest wiedzieć question_text_view na strunach, ale popełniła tablicę w mojej działalności który bierze wszystkie pytania mQuestionTextView = (TextView) findViewById (R.id.question_text_view); int question = mQuestionBank [mCurrentIndex] .getQuestion(); mQuestionTextView.setText (pytanie); mQuestionBank jest tablicą wszystkich pytań, które zadaję getQuestion() jest moja metoda getter dla uzyskania pytanie
a drugi błąd dla next_button Nie wiem co zrobiłem źle, odkąd włączyła ją na strings.xml Czy ktoś może mi pomóc
android id = "@ id/question_text_view" należy android id = "@ + Id/question_text_view" jednakowa dla przycisku android : id = "@ + id/next_button" – Raghunandan
plz zobacz [Więcej typów zasobów] (h ttp: //developer.android.com/guide/topics/resources/more-resources.html#Id) do definiowania identyfikatorów dla widoków w xml. będziesz musiał użyć ' ' zamiast ' ' do umieszczenia id's w pliku strings.xml lub możesz stworzyć osobny plik dla niego jak ids.xml –