teoREtik teoREtik - 1 year ago 68
Android Question

How to get Activity's content view?

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

Answer Source
this.getWindow().getDecorView().findViewById(android.R.id.content)

or

this.findViewById(android.R.id.content)

or

this.findViewById(android.R.id.content).getRootView()