title: Find a TextView from a View that has been Inflated
body: <p>In Xamarin, if I <code>Inflate</code> a <code>View</code>, how can I set the text of a <code>TextView</code> in the <code>View</code>?</p>
  
  <p>I am wanting to code an application where I can call methods in different fragments to pass values between fragments and display these values.</p>
  
  <p>Here is my <code>MainActivity</code> code:</p>
  
  <pre><code>public class MainActivity : FragmentActivity
  {
      string message;
  
      FragmentOrange fragOrange;
      FragmentGreen fragGreen;
      FragmentRed fragRed;
  
      protected override void OnCreate (Bundle bundle)
      {
          base.OnCreate (bundle);
  
          SetContentView (Resource.Layout.activity_main);
  
          fragOrange = new FragmentOrange ();
          fragGreen = new FragmentGreen ();
          fragRed = new FragmentRed ();
  
          List&lt;Android.Support.V4.App.Fragment&gt; fragments = new List&lt;Android.Support.V4.App.Fragment&gt;();
          fragments.Add(fragOrange);
          fragments.Add(fragGreen);
          fragments.Add(fragRed);
  
          MyPagerAdapter pageAdapter = new MyPagerAdapter(SupportFragmentManager, fragments);
          var pager = FindViewById&lt;ViewPager&gt;(Resource.Id.myViewPager);
          pager.Adapter = pageAdapter;
  
          pager.SetCurrentItem (0, true);
          fragOrange.SetMessage ("Fragment orange");
      }
  }
  </code></pre>
  
  <p>Here is my <code>FragmentOrange</code> code:</p>
  
  <pre><code>public class FragmentOrange : Android.Support.V4.App.Fragment
  {
      string message;
      TextView textViewDisplay;
      View view;
  
      public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  
          view = inflater.Inflate(Resource.Layout.fragment_orange, container, false);
          textViewDisplay = view.FindViewById&lt;TextView&gt;(Resource.Id.textViewDisplay);
          return view;
      }
  
      public void SetMessage(string value)
      {
          message = value;
          textViewDisplay.Text = value;
      }
  }
  </code></pre>
  
  <p>When I call the <code>SetMessage</code> function, I get the following error:</p>
  
  <blockquote>
    <p>Object reference not set to an instance of an object</p>
  </blockquote>
  
  <p>At this line of code:</p>
  
  <pre><code>textViewDisplay.Text = value;
  </code></pre>
  
  <p>Here is my <code>Layout</code> code:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"&gt;
      &lt;TextView
          android:text="Text"
          android:id="@+id/textViewDisplay"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Thanks in advance</p>