Android
Résolu
Pepito39
Messages postés
99
Statut
Membre
-
Pepito39 Messages postés 99 Statut Membre -
Pepito39 Messages postés 99 Statut Membre -
Bien le bonjour,
J'ai un petit soucis au niveau de mon interface graphique, je dispose d'un fichier xml où j'ai créé quelques vues pour mon application, mais le soucis, c'est que quand je compile mon projet, aucun élément de ce fichier xml ne s'affiche sur l'émulateur.
Pourtant, j'ai bien mis "setContentView(R.layout.activity_main); " dans le java.
Je comprends pas pourquoi... :/
Pouvez vous m'aider?
Merci d'avance :)
J'ai un petit soucis au niveau de mon interface graphique, je dispose d'un fichier xml où j'ai créé quelques vues pour mon application, mais le soucis, c'est que quand je compile mon projet, aucun élément de ce fichier xml ne s'affiche sur l'émulateur.
Pourtant, j'ai bien mis "setContentView(R.layout.activity_main); " dans le java.
Je comprends pas pourquoi... :/
Pouvez vous m'aider?
Merci d'avance :)
A voir également:
- Android
- Android recovery - Guide
- Begone android - Accueil - Protection
- Presse papier android - Guide
- À quoi sert google drive sur android - Guide
- Jouer a pokemon sur android - Guide
2 réponses
Je viens de remarquer que j'avais cette erreur:
Error in an XML file: aborting build.
Comment peut-on régler ce problème?
Error in an XML file: aborting build.
Comment peut-on régler ce problème?
Je vais mettre en gras les erreurs !
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
andoid:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/nom_client"
android:textStyle="bold"
android:textColor="#000000"
android:gravity="center"/>
<EditText
android:id="@+id/EtNom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Nom"
andoid:inputType="text"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Prénom :"
android:textStyle="bold"
android:textColor="#000000"
android:gravity="center"/>
<EditText
android:id="@+id/EtPrenom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Prénom"
android:inputType="text"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Adresse :"
android:textStyle="bold"
android:textColor="#000000"
android:gravity="center"/>
<EditText
android:id="@+id/EtAdresse"
android:layout_width="match_parent"
android:layout_height="wrap_content"
andoid:hint="Adresse"
android:inputType="text"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Code postale :"
android:textStyle="bold"
android:textColor="#000000"
android:gravity="center"/>
<EditText
android:id="@+id/EtCp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
andoid:hint="Code postale"
android:inputType="text"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Ville :"
android:textStyle="bold"
android:textColor="#000000"
android:gravity="center"/>
<EditText
android:id="@+id/EtVille"
android:layout_width="match_parent"
android:layout_height="wrap_content"
andoid:hint="Ville"
android:inputType="text"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Adresse mail :"
android:textStyle="bold"
android:textColor="#000000"
android:gravity="center"/>
<EditText
android:id="@+id/EtMail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
andoid:hint="Mail"
android:inputType="text"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Téléphone :"
android:textStyle="bold"
android:textColor="#000000"
android:gravity="center"/>
<EditText
android:id="@+id/EtTel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
andoid:hint="Tel"
android:inputType="text"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Nombre de pizzas achetées :"
android:textStyle="bold"
android:textColor="#000000"
android:gravity="center"/>
<EditText
android:id="@+id/EtNbpizza"
android:layout_width="match_parent"
android:layout_height="wrap_content"
andoid:hint="Pizza achetées"
android:inputType="number"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Nombre total de pizzas :"
android:textStyle="bold"
android:textColor="#000000"
android:gravity="center"/>
<EditText
android:id="@+id/EtTotalpizza"
android:layout_width="match_parent"
android:layout_height="wrap_content"
andoid:hint="Total"
android:inputType="text"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
Une fois ces erreurs corrigées plus de problème ;)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
andoid:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/nom_client"
android:textStyle="bold"
android:textColor="#000000"
android:gravity="center"/>
<EditText
android:id="@+id/EtNom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Nom"
andoid:inputType="text"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Prénom :"
android:textStyle="bold"
android:textColor="#000000"
android:gravity="center"/>
<EditText
android:id="@+id/EtPrenom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Prénom"
android:inputType="text"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Adresse :"
android:textStyle="bold"
android:textColor="#000000"
android:gravity="center"/>
<EditText
android:id="@+id/EtAdresse"
android:layout_width="match_parent"
android:layout_height="wrap_content"
andoid:hint="Adresse"
android:inputType="text"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Code postale :"
android:textStyle="bold"
android:textColor="#000000"
android:gravity="center"/>
<EditText
android:id="@+id/EtCp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
andoid:hint="Code postale"
android:inputType="text"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Ville :"
android:textStyle="bold"
android:textColor="#000000"
android:gravity="center"/>
<EditText
android:id="@+id/EtVille"
android:layout_width="match_parent"
android:layout_height="wrap_content"
andoid:hint="Ville"
android:inputType="text"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Adresse mail :"
android:textStyle="bold"
android:textColor="#000000"
android:gravity="center"/>
<EditText
android:id="@+id/EtMail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
andoid:hint="Mail"
android:inputType="text"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Téléphone :"
android:textStyle="bold"
android:textColor="#000000"
android:gravity="center"/>
<EditText
android:id="@+id/EtTel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
andoid:hint="Tel"
android:inputType="text"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Nombre de pizzas achetées :"
android:textStyle="bold"
android:textColor="#000000"
android:gravity="center"/>
<EditText
android:id="@+id/EtNbpizza"
android:layout_width="match_parent"
android:layout_height="wrap_content"
andoid:hint="Pizza achetées"
android:inputType="number"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Nombre total de pizzas :"
android:textStyle="bold"
android:textColor="#000000"
android:gravity="center"/>
<EditText
android:id="@+id/EtTotalpizza"
android:layout_width="match_parent"
android:layout_height="wrap_content"
andoid:hint="Total"
android:inputType="text"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
Une fois ces erreurs corrigées plus de problème ;)
Voici le code du 2ème fichier:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <LinearLayout andoid:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/nom_client" android:textStyle="bold" android:textColor="#000000" android:gravity="center"/> <EditText android:id="@+id/EtNom" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Nom" andoid:inputType="text" android:layout_weight="1"/> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Prénom :" android:textStyle="bold" android:textColor="#000000" android:gravity="center"/> <EditText android:id="@+id/EtPrenom" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Prénom" android:inputType="text" android:layout_weight="1"/> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Adresse :" android:textStyle="bold" android:textColor="#000000" android:gravity="center"/> <EditText android:id="@+id/EtAdresse" android:layout_width="match_parent" android:layout_height="wrap_content" andoid:hint="Adresse" android:inputType="text" android:layout_weight="1" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Code postale :" android:textStyle="bold" android:textColor="#000000" android:gravity="center"/> <EditText android:id="@+id/EtCp" android:layout_width="match_parent" android:layout_height="wrap_content" andoid:hint="Code postale" android:inputType="text" android:layout_weight="1" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Ville :" android:textStyle="bold" android:textColor="#000000" android:gravity="center"/> <EditText android:id="@+id/EtVille" android:layout_width="match_parent" android:layout_height="wrap_content" andoid:hint="Ville" android:inputType="text" android:layout_weight="1" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Adresse mail :" android:textStyle="bold" android:textColor="#000000" android:gravity="center"/> <EditText android:id="@+id/EtMail" android:layout_width="match_parent" android:layout_height="wrap_content" andoid:hint="Mail" android:inputType="text" android:layout_weight="1" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Téléphone :" android:textStyle="bold" android:textColor="#000000" android:gravity="center"/> <EditText android:id="@+id/EtTel" android:layout_width="match_parent" android:layout_height="wrap_content" andoid:hint="Tel" android:inputType="text" android:layout_weight="1" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Nombre de pizzas achetées :" android:textStyle="bold" android:textColor="#000000" android:gravity="center"/> <EditText android:id="@+id/EtNbpizza" android:layout_width="match_parent" android:layout_height="wrap_content" andoid:hint="Pizza achetées" android:inputType="number" android:layout_weight="1" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="match_parent" android:text="Nombre total de pizzas :" android:textStyle="bold" android:textColor="#000000" android:gravity="center"/> <EditText android:id="@+id/EtTotalpizza" android:layout_width="match_parent" android:layout_height="wrap_content" andoid:hint="Total" android:inputType="text" android:layout_weight="1" /> </LinearLayout> </LinearLayout>