title: findViewById in Fragment
body: <p>I am trying to create an ImageView in a Fragment which will refer to the ImageView element which I have created in the XML for the Fragment. However, the <code>findViewById</code> method only works if I extend an Activity class. Is there anyway of which I can use it in Fragment as well?</p>
  
  <pre><code>public class TestClass extends Fragment {
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          ImageView imageView = (ImageView)findViewById(R.id.my_image);
          return inflater.inflate(R.layout.testclassfragment, container, false);
      }
  }
  </code></pre>
  
  <p>The <code>findViewById</code> method has an error on it which states that the method is undefined.</p>