title: Android Spinner setOnItemSelectedListener not working
body: <p>I have made a spinner dynamically during a login process.  I'd like to be able to return the value of the spinner when I click on an option but it doesn't seem to work.</p>
  
  <p>I make the spinner here:</p>
  
  <pre><code>public Spinner page_spinner;
  
  protected void onCreate(Bundle savedInstanceState){
  ...
  page_spinner = (Spinner) findViewById(R.id.page_spinner);
  ...
  //MAKE ARRAY HERE
  GraphRequest requestPage = GraphRequest.newGraphPathRequest(
      currentAccessToken,
      "/me/accounts",
      new GraphRequest.Callback() {
          @Override
          public void onCompleted(GraphResponse response) {
              JSONArray jsonArray = null;
              try {
                  jsonArray = response.getJSONObject().getJSONArray("data");
                  for(int i=0; i &lt; jsonArray.length(); i++){
                  JSONObject page = jsonArray.getJSONObject(i);
                  String pageName = page.getString("name");
                  if(!pageName.equals("")) {
                      //Push names into the array
                      pages_array.add(pageName);
                  } else {
                      pages_array.clear();
                  }
              }
          } catch (JSONException e) {
              e.printStackTrace();
          }
      }
  });
  Bundle pageParameters = new Bundle();
  pageParameters.putString("fields", "name,access_token,picture{url}");
  requestPage.setParameters(pageParameters);
  requestPage.executeAsync();
  ...
  ArrayAdapter&lt;String&gt; spinnerArrayAdapter = new ArrayAdapter&lt;String&gt;(StartPage.this, android.R.layout.simple_spinner_item, pages_array);
  spinnerArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); // The drop down view
  page_spinner.setAdapter(spinnerArrayAdapter);
  spinnerArrayAdapter.notifyDataSetChanged();
  </code></pre>
  
  <p>then I try to use the spinner here:</p>
  
  <pre><code>page_spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
      @Override
      public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id) {
          Log.d("***********", "THIS ");
      }
      @Override
      public void onNothingSelected(AdapterView&lt;?&gt; parent) {
          Log.d("***********", "THIS ");
      }
  });
  </code></pre>
  
  <p>I don't ever get the <code>Log.d</code> or even if I made <code>Toast</code> there, it doesn't fire.  Not sure why this is stopping and I'm not getting any errors.  </p>
  
  <p>Any ideas?</p>