A.Schtolc
A.Schtolc

Reputation: 37

How to change background of the app?

Is there a way to change background directly in the app? (!not homescreen wallpaper)

Upvotes: 0

Views: 118

Answers (2)

B.Denis
B.Denis

Reputation: 23

i have a link for you is easy to change background app. Try something like that https://www.youtube.com/watch?v=mDKuWIlSNJE

Upvotes: 0

Loic P.
Loic P.

Reputation: 711

You need to specify the layout that its background will be changed. I guess you have a LinearLayout, so add an id to the layout (if it is not exist):

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id=@+id/parentLayout>  

Then you can change the background in Java with:

LinearLayout linearLayout = (LinearLayout) findViewById(R.id.parentLayout);
linearLayout.setBackgroundResource(R.drawable.new_background);

Hope it helps you!

Upvotes: 1

Related Questions