Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Simple Android App (retired 2014) Pretty Little Things Adding an Image

Justin Ezor
Justin Ezor
2,193 Points

Adding an Image --Android dev-- Crystal Ball project

There is a known issue on this video, and after following the instructions to import the project files, I am stuck. The teacher's notes send me to a video for a different project to show me how to import the files. Some more in depth instructions on how to import the files specific to this project would be awesome!

1 Answer

Matheus G Oliveira
Matheus G Oliveira
9,682 Points

You are trying to add the background image to the Crystall Ball Project?

if yes,

it is simple.

add this to the activity.xml you want to add a background image. PS.: dont forget to drag and drop the image to the drawable file on res directory.

         android:background="@drawable/your_image_name" 

the code below goes inside of the relative layout where you have something like these: EXample: xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="fill"