Remove background drawable programmatically in Android

前端 未结 11 1569
忘掉有多难
忘掉有多难 2020-12-07 17:17

I want to remove the background drawable @drawable/bg programmatically. Is there a way to do that?

Currently, I have the following XML in my layout:

11条回答
  •  情书的邮戳
    2020-12-07 17:48

    Best performance on this method :

    imageview.setBackgroundResource(R.drawable.location_light_green);
    

    Use this.

提交回复
热议问题