axool Posted March 14, 2011 Share Posted March 14, 2011 Bonjour, J'essaye désespérément d'ajouter une image de fond sur mon appli mais ceci provoque un crash ("Forcer la fermeture") au démarrage de celle-ci. Voici un extrait de mon code : <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_vertical" android:background="@drawable/android" android:orientation="vertical" > Mon background se nomme bien "android.jpg" et se trouve dans le dossier "res/drawable". Si vous pouvez m'aider, je vous écoute ! Link to comment Share on other sites More sharing options...
chpil Posted March 15, 2011 Share Posted March 15, 2011 Et quelle est l'exception qui se produit ? Que te disent les traces dans le LogCat ? Link to comment Share on other sites More sharing options...
axool Posted March 15, 2011 Author Share Posted March 15, 2011 Visiblement j'ai un "NotFoundException" alors que mon fichier se trouve bien à l'endroit prévu : $NotFoundException: File res/drawable/android.jpg from xml type layout resource ID #0x7f020000 Je comprends pas vraiment là ... Même quand je retire la ligne "android:background="@drawable/android", j'ai une erreur ... Le fichier .jpg semble poser problème ... EDIT : résolu en faisant un "Clean & Build" sous NetBeans ... Link to comment Share on other sites More sharing options...
Sakaroz Posted March 16, 2011 Share Posted March 16, 2011 Avec Android, code sous Eclipse, c'est prévu pour ;) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.