title: How to setdata for a fragment when data is recieved to present activity as intents from previous activity
body: <p><strong>Overview</strong>:: </p>
  
  <ul>
  <li>I am receiving data from another activity to my present activity as
  intents and im storing it in present activity as a variable named <code>recievedData</code></li>
  <li>Now my present activity has a fragment in it.</li>
  <li>The fragment has a textview</li>
  </ul>
  
  <p><strong>Q</strong>::So how can i set the textview ? </p>
  
  <hr>
  
  <p><strong>MainActivityTwo.java</strong></p>
  
  <pre><code>public class MainActivityTwo extends FragmentActivity
  {
  
      FragmentManager objFrgMng=getSupportFragmentManager();
      FragmentTransaction objFrgTrns;
      FragmentTwo objFrgTwo=new FragmentTwo();
      String recievedData;
      protected void onCreate(Bundle savedInstanceState) 
      {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main_act_two_container);        
          Bundle extras=getIntent().getExtras();
          recievedData=extras.getString("key");   
          Log.d("RECIEVED-DATA", recievedData);
                  getSupportFragmentManager().beginTransaction().add(R.id.mainActTwoContainerId,objFrgTwo, "MainActFrgTwoTag").commit();
  
  
      }
  
  }
  </code></pre>
  
  <p><strong>main_act_two_container.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent" 
      android:id="@+id/mainActTwoContainerId" &gt;
  
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>fragment_two.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="#084B8A" &gt;
  
      &lt;TextView
          android:id="@+id/textViewId"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentTop="true"
          android:layout_centerHorizontal="true"
          android:layout_marginTop="161dp"
          android:text="Large Text"
          android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>FragmentTwo.java</strong></p>
  
  <pre><code>public class FragmentTwo extends Fragment{
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
          // TODO Auto-generated method stub
  
          View ObjFrgOneView=inflater.inflate(R.layout.fragment_two, container, false);
  
          return ObjFrgOneView;
  
      }
  
  }
  </code></pre>
  
  <p><strong>note</strong>:: all im doing is dynamically</p>