title: Android-The method findViewById(int) is undefined for the type first (Fragment)
body: <p>I'm new to fragments and i'm developing an application using Swipe view with tabs. My aim here is to get a textview display texts stored in the string-array and changes whenever the application is restarted. 
  But there seems to be a problem when i'm using findViewById.</p>
  
  <p>Code:   </p>
  
  <p>First.java</p>
  
  <pre><code>import java.util.Random;
  
  import android.support.v4.app.Fragment;
  import android.app.Dialog;
  import android.os.Bundle;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.TextView;
  
  public class first extends Fragment{
  
  String[] strArr;
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      View rootView = inflater.inflate(R.layout.first_xml, container, false);
      strArr = getResources().getStringArray(R.array.quote);
               //quote is the name given to the string array
  
      return rootView;
  }
  
  
  
  
  @Override
  public void onResume() {
      // TODO Auto-generated method stub
      super.onResume();
      refreshTV();
  }
  
  void refreshTV(){
          TextView tv = (TextView)findViewById(R.id.text1);
          Random ran = new Random();
          int c = ran.nextInt(strArr.length);
          tv.setText(strArr[c]);
  
  
      }
  
  }
  </code></pre>
  
  <p>2.first_xml.xml</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="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical"
      android:background="#fa6a6a" &gt;
  
  &lt;TextView android:layout_width="fill_parent"
      android:id="@+id/text1"
      android:layout_height="wrap_content"
      android:gravity="center"
      android:text="@array/quote"
      android:textSize="40dp"
      android:layout_centerInParent="true"/&gt;
  
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Any help will be appreciated.
  Please Let me know if anything i mentioned is not clear enough.
  Thank you !</p>