Reputation: 37
Is there a way to change background directly in the app? (!not homescreen wallpaper)
Upvotes: 0
Views: 118
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
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