title: .setAdapter(adapter); Giving an NullPointerException
body: <p>I am trying to make adapters for spinners, however I get an NullPointerException on answertime.setAdapter(adapter); Why is this? My arrays are in the strings.xml where they should be?
  Here is the full code.</p>
  
  <pre><code>package lijap.app.starcraft2counters;
  
  import java.io.File;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.os.Environment;
  import android.view.View;
  import android.widget.AdapterView;
  import android.widget.AdapterView.OnItemSelectedListener;
  import android.widget.ArrayAdapter;
  import android.widget.Spinner;
  import android.widget.Toast;
  
  public class Settings extends Activity implements OnItemSelectedListener {
  Spinner answertime;
  Spinner gametime;
  Spinner missesallowed;
  
  String[] answerseconds = { "Unlimited", "1 second", "2 seconds",
          "3 seconds", "4 seconds", "5 seconds" };
  
  String[] gameminutes = { "Unlimited", "1 minute", "2 minutes", "3 minutes",
          "4 minutes", "5 minutes" };
  
  String[] numberofmisses = { "Unlimited", "5", "10", "15", "20", "25" };
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      setContentView(R.layout.settings);
  
      ArrayAdapter adapter = ArrayAdapter.createFromResource(this, R.array.AnswerSeconds, R.layout.custom_spinner_list);
      adapter.setDropDownViewResource(R.layout.custom_spinner);
      answertime.setAdapter(adapter);
  
      ArrayAdapter adapter2 = ArrayAdapter.createFromResource(this, R.array.GameMinutes, R.layout.custom_spinner_list);
      adapter.setDropDownViewResource(R.layout.custom_spinner);
      gametime.setAdapter(adapter);
  
      ArrayAdapter adapter3 = ArrayAdapter.createFromResource(this, R.array.NumberOfMisses, R.layout.custom_spinner_list);
      adapter.setDropDownViewResource(R.layout.custom_spinner);
      missesallowed.setAdapter(adapter);
  
  
      answertime = (Spinner) findViewById(R.id.s_answertime);
      answertime.setAdapter(adapter);
      answertime.setOnItemSelectedListener(this);
  
  
      missesallowed = (Spinner) findViewById(R.id.s_mistakenumber);
      missesallowed.setAdapter(adapter2);
      missesallowed.setOnItemSelectedListener(this);
  
      gametime = (Spinner) findViewById(R.id.s_gametime);
      gametime.setAdapter(adapter3);
      gametime.setOnItemSelectedListener(this);
  }
  
  @Override
  public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1, int arg2,
          long arg3) {
      // TODO Auto-generated method stub
  
  }
  
  @Override
  public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
      // TODO Auto-generated method stub
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Any help is appreciated- Lijap</p>