how to add background image to activity?

Viewed 409600

using theme or ImageView ?

7 Answers

ez way : copy your picture in this location: C:\Users\Your user name\AndroidStudioProjects\yourProjectName\app\src\main\res\drawable

and write this code in your xml file:

 <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@drawable/background">

</RelativeLayout>

in line 7 write your file name instand of background

and Tamam...

Related