Ich lerne derzeit Android-Entwicklung für ein Universitätsmodul, so tut mir leid, wenn dies ein sehr grundlegender Fehler ist. Ich bin im Moment nur this tutorial folgen, zu verstehen, wie Android Java unterscheidet sich von normalen Java und so weiter.XML-Tools Kontextfehler
Auf der XML-Datei activity_main ich die folgende Fehlermeldung erhalten:
Cannot resolve symbol ${relativePackage}.${activityClass} Validates resource references inside Android XML Files
ich verwendet habe Google und Stackoverflow Suche nach möglichen Lösungen zu suchen, fand ich einige Artikel es besagen, kann wegen schlechter XML sein Formatierung, wo ich glaube, der Fehler ist. Ich habe auch versucht, das Projekt auszuführen, und es kann die Klassendatei R nicht finden. Ich habe das Projekt gereinigt und neu erstellt, aber der Fehler tritt weiterhin auf.
Here is my code if you would like to take a look. Obwohl es im Moment der Tutorial-Website sehr ähnlich ist.
Mein xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="${relativePackage}.${activityClass}" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/welcome"
android:textSize="20dp" />
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:textColor="@color/lbl_name"
android:textSize="24dp" />
<TextView
android:id="@+id/email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="13dp" />
<Button
android:id="@+id/btnLogout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dip"
android:background="@color/btn_logut_bg"
android:text="@string/btn_logout"
android:textAllCaps="false"
android:textColor="@color/white"
android:textSize="15dp" />
</LinearLayout>
</RelativeLayout>
Jede Hilfe viel appreicated ist, danke
PS I Android Studio verwenden in meiner Layout-Datei
relativePackage und activityClass sind zwei getrennte Fehler – NeedHelpSK
Schreiben Sie die xml, die den Fehler hat bitte –
@JuanCruzSoler hier ist die XML, die den Fehler hat http://pastebin.com/vcxvRd2R – NeedHelpSK