title: arrayadapter for spinner not working in fragment, requires resource id
body: <p>i am getting an error that ArrayAdapter does not have resource id, however the resource id is used here and i used similar code in an activity with no problem however this is in a fragment.  is there something i am supposed to do differently because it is in a fragment?  and that is why it is not working?</p>
  
  <p>i made a xml layout and put a textView in it as required.</p>
  
  <p>any ideas on how to get this working?</p>
  
  <p>stack trace</p>
  
  <pre><code> 07-16 20:11:44.290: E/AndroidRuntime(14278): FATAL EXCEPTION: main
   07-16 20:11:44.290: E/AndroidRuntime(14278): java.lang.IllegalStateException:   ArrayAdapter requires the resource ID to be a TextView
   07-16 20:11:44.290: E/AndroidRuntime(14278):   at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:386)
   07-16 20:11:44.290: E/AndroidRuntime(14278):   at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362)
  </code></pre>
  
  <p>oncreateview method from the fragment. this method is where all the action is</p>
  
  <pre><code> @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
  
          View result=inflater.inflate(R.layout.small_tank_layout11, container, false);
  
          activity = getActivity();
  
           // set shared preferences variable with shared preferences object for use
          prefs = activity.getSharedPreferences("smallTankPreferences", Context.MODE_PRIVATE);
  
          textViewOne = (TextView) result.findViewById(R.id.textView1);
          textViewTwo = (TextView) result.findViewById(R.id.textView2);
          spinnerOne = (Spinner) result.findViewById(R.id.spinner1);
          buttonOne = (Button) result.findViewById(R.id.button1);
  
          // get stored title quesion and set text
          smallTank11question = prefs.getString("smallTank11question", "");
          textViewOne.setText(smallTank11question);
  
          // get arraylist from json string
          Gson gson = new Gson();
           Type type = new TypeToken&lt;ArrayList&lt;String&gt;&gt;(){}.getType();
           smallTank11WeatherNames = prefs.getString("smallTank11WeatherNames", "");
           smallTank11WeatherNamesArray = gson.fromJson(smallTank11WeatherNames, type);
  
           // get the weather selected indicator stored in shared prefereces
           smallTank11WeatherSelected = prefs.getInt("smallTank11WeatherSelected", -1);
  
      //put strings of weather selections into spinner
         ArrayAdapter&lt;String&gt; dataAdapter = new ArrayAdapter&lt;String&gt;(activity, R.layout.small_tank_spinnerlayout_one, smallTank11WeatherNamesArray);  // layout for spinner itself
          dataAdapter.setDropDownViewResource(R.layout.small_tank_spinnerlayout_one); // layout for spinner dropdown items
          spinnerOne.setAdapter(dataAdapter);
  
  
          return result;
  
      } // end oncreateview
  </code></pre>
  
  <p>Edit here i added the code for small_tank_spinnerlayout_one.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical" &gt;
  
  &lt;TextView
      android:id="@+id/textView1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Large Text"
      android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>