title: How to use a View in a Fragment inside a TabLayout's tab in Activity?
body: <p>I want to know how to access a view inside a fragment from an activity, knowing that the fragment shows in a tab under TabLayout. When I define for example a TextView1 -which is in fragment- in Activity, no problem with that, but once I need to set an action for TextView1 -like onClickListener- it crashes.</p>
  
  <p>I don't know if I can do it like this directly, or I have to get the fragment first from inside the tab. As I said, trying to do an action directly would make the app crashes, about getting the fragment or the view from inside the tab, I have no clue.
  The error I get for that is: <strong>Attempt to invoke virtual method 'void android.widget.edittext.settext(java.lang.charsequence)' on a null object reference</strong></p>
  
  <p>I just need to know what to add in fragment's java class, or in Activity class or both to make the goal view accessible in Activity.</p>