Change activity background from code

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

I have an activity with a background:



        
3条回答
  •  我在风中等你
    2021-01-05 12:25

    first add LinearLayout id as in your layout xml:

    and in code part set background as::

    LinearLayout  linearLayout = (LinearLayout) findViewById(R.id.linearLayoutid);
     linearLayout.setBackgroundResource(R.drawable.background_fingerboard);
    

提交回复
热议问题