title: Access Fragment elements from Activity parent in Android Studio
body: <p>I need to implement in a android app a big form that have 4 sections, so i created 01 Activity with 4 fragments using the ViewPager. Each fragment has some EditText fields. On the 4th fragment, i have the Button to finish the form, so i'd like to click on it and get all the EditText fields.</p>
  
  <p>I think the best solution is to get all of these EditText fields on the MainActivity.java , but when i try to access theses elements from any fragment, I get only this error: Attempt to invoke virtual method 'android.text.Editable android.widget.EditText.getText()' on a null object reference</p>
  
  <p>any idea how to access these elements or any better solution?</p>