Android: What is android.R.id.content used for?

user996659 picture user996659 · Oct 15, 2011 · Viewed 71.8k times · Source

Anybody could explain the meaning of "android.R.id.content" ?

How is it being used ?

http://developer.android.com does not have any explanation.

public static final int content
Since: API Level 1

Constant Value: 16908290 (0x01020002)

Answer

Gili picture Gili · Oct 15, 2012

As Philipp Reichart commented:

android.R.id.content gives you the root element of a view, without having to know its actual name/type/ID. Check out http://stackoverflow.com/questions/4486034/android-how-to-get-root-view-from-current-activity