I think you may be confused about the difference between a component ID and a layout ID.
A layout ID refers to the name of a layout XML file. For example, if you have a layout named res/layout/home_activity.xml
, its ID would be stored as R.layout.home_activity
.
A component ID refers to the identity of a UI component inside an existing layout. So, inside your home_activity.xml
layout you might have <TextView android:id="@+id/my_textview" />
. The ID of that View is R.id.my_textview
.
You can only inflate layouts using a layout ID. 'Inflating' a component ID doesn't make any sense, unless you inflate a layout as a child of a View with a specific ID.