My android learning experience 9 and android learning experience 9
Add a background image to the android activity
1.you can download images of Android on the Internet or create images in the png format. (Note that the image size should be suitable for your mobile phone screen or AVD screen. You can download the corresponding images or make them by yourself)
2. Add the image prepared in step 1 to the drawable-hdpi folder in the res folder of the project. You can add the image in either of the following ways:
(1) You can open the drawable-hdpi folder in the res folder of the corresponding project in your work interval and add the png Image to it.
(2) drag the image directly to the drawable-hdpi folder in eclipse.
3. Open the layout file (xml file in the layout folder under the res folder) and write the following code in the layout.
Android: background = "@ drawable/p1" p1 is the image name