How to get Activity's content view?

前端 未结 8 731
一向
一向 2020-11-27 09:22

What method should I call to know if an Activity has its contentView (once the method setContentView() has been called)?

8条回答
  •  北海茫月
    2020-11-27 10:00

    If you are using Kotlin

        this.findViewById(android.R.id.content)
                             .rootView
                             .setBackgroundColor(ContextCompat.getColor(this, R.color.black))
    

提交回复
热议问题