Zwiebel
Zwiebel

Reputation: 1615

How I can change the Background in runtime in Android?

I want to make a simple program with 2 Radiobutton (rd1 and rd2), what can change background to picture s1, or s2, depend on what was selected. How I can make it? I tried background.setBackground (background is my RadioGroup's name), but it didn't work.

Upvotes: 0

Views: 3275

Answers (1)

Ganapathy C
Ganapathy C

Reputation: 5999

try this for changing android wallpaper.

http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/SetWallpaperActivity.html

and if you want change the background for the current activity means

if your layout is lay means then,

lay.BackgroundDrawable(R.drawable.abc);

in onClick listenerof ur radio button

sure it will help you dude..let me know what happened...

Thank you.

Upvotes: 1

Related Questions