Full screen background image in an activity

There are several ways you can do it.

Option 1:

Create different perfect images for different dpi and place them in related drawable folder. Then set

android:background="https://stackoverflow.com/questions/16135984/@drawable/your_image"

Option 2:

Add a single large image. Use FrameLayout. As a first child add an ImageView. Set the following in your ImageView.

android:src="https://stackoverflow.com/questions/16135984/@drawable/your_image"
android:scaleType = "centerCrop"

Leave a Comment