title: How to set Different String in a Textview in Fragment while clicking different Button?
body: <p>I'm new to Android app programming.</p>
  
  <p>I have two Fragments - <code>fragmentA.xml</code> and <code>fragmentB.xml</code>.</p>
  
  <p>In <code>fragmentA</code> there are two Buttons - Button One (id: <code>btnOne</code>) and Button Two (id: <code>btnTwo</code>).</p>
  
  <p>In <code>fragmentB</code> there is TextView (id- <code>textView</code>)</p>
  
  <p>In <code>fragmentB</code> java class there are two <code>String</code> - <code>string1</code> and <code>string2</code></p>
  
  <p>Both buttons refers to <code>fragmentB</code>.</p>
  
  <p>I want two set the <code>textView</code> text to <code>string1</code> when I press Button One 
  and <code>string2</code> when I press Button Two.</p>
  
  <p>How can I do that?</p>
  
  <p>I was using following code in <code>fragmentB</code> java class to display only <code>string1</code></p>
  
  <pre><code>public View onCreateView(
      LayoutInflater inflater, 
      ViewGroup container, 
      Bundle savedInstanceState) 
  {
      View rootView = inflater.inflate(R.layout.oop_page,container,false);
      TextView textV = (TextView)rootView.findViewById(R.id.textView);
      textV.setText(string1);
      return rootView;
  }
  </code></pre>
  
  <p>Can I use any if-else statement here?</p>
  
  <p>Thanx</p>