I have an activity with several tabs (using the 'fixed tabs + swipe' style). Each tab layout is defined as a fragment xml file.
Eg, my activity is called ModifyCustActivity
. This uses an almost-empty xml file called activity_modify_cust.xml
. Each tab on this page is represented by various xml files such as fragment_modify_cust_basic
and fragment_modify_cust_address
etc etc. Each of these fragment xml files contains EditText
s, Spinner
s and more.
When the activity starts, I need to be able to access these views from the activity code, as I need to pre-populate them, and get their results once they are edited. However, because these views exist in a fragment xml file, I don't seem to be able to reach them in code. Is there a way to access a view contained in a fragment xml file?