Activity setContent() to another layout file
<p>I have activity_main which is default layout in my activity, there i have framelayout which display fragment whit different layout, is it possible to connect the different layout textview to setText() from my activity? How to connect from activity to this fragment xml layout?</p>

<pre><code>activity_main
   frameLayout
      fragment 1 xml
      fragment 2 xml
   /frameLayout
</code></pre>

<p>Activit.java</p>

<pre><code>protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    dirShow("a");
}


void dirShow(String s) {
    setContentView(R.layout.fragment1);
    textPath = (TextView) findViewById(R.id.path_text);
    textPath.setText(s);
}
</code></pre>
