I'd like to know if it is possible to define one element, in this case a drawer, in one xml file and then call it on all the layouts, so I don't have to manually define the drawer each time, reducing the chance of errors and the effort needed to fix it.
EDIT:
So this is the list view, that is the drawer:
<ListView
android:id="@id/navList"
android:layout_width="180dp"
android:layout_height="match_parent"
android:layout_gravity="left|start"
android:background="#ffeeeeee"/>
And this is the java code so I can put what i want on the list:
private void addDrawerItems() {
Resources res = getResources();
String[] osArray = res.getStringArray(R.array.DrawerButtons);
mAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, osArray);
mDrawerList.setAdapter(mAdapter);
}
mDrawerList = (ListView)findViewById(R.id.navList);
I'm asking what might look like a stupid question, or an easy one, but I really don't know, I only started fiddling with Android Development yesterday.