Change activity background from code

后端 未结 3 1904
情深已故
情深已故 2021-01-05 11:26

I have an activity with a background:



        
3条回答
  •  耶瑟儿~
    2021-01-05 12:08

    LinearLayout  vi = (LinearLayout ) findViewById()
    vi.setBackgroundResource(R.drawable.);
    

    you need to provide the id to your LinearLayout in XML as well....

提交回复
热议问题