You could use a vector image, but if you don’t want to just do the following:
1º => change the view of your project from "android" to "project".
2º => Then create in the folder "res" the folders drawable-land and drawable-port
Add your background to vertical in the drawable-port folder and the horizontal in the drawable-land folder.
OBS => WITH THE SAME NAME!!!
3º => Both your horizontal and vertical background must have the same name, for in the . xml of Activity you do the following:
android:background="@drawable/background"
When the device is upright, the image contained in the drawable-port will be displayed and when it is moved to the horizontal the image contained in the drawable-land will appear.
About making 2 backgrounds, one vertical and one horizontal take the following as example:
horizontal (1280x720):
vertical (720x1280):
See if it helps: Changing view background image on orientation change
– user28595
See the documentation
– ramaral