title: Android Spinner does not work
body: <p>i'm doing a spinner that retrieves its items from an API, i checked Postman results but there's no error there and somehow i cant even click the spinner or the spinner just doesnt drop down, here's the codes, i checked all other solutions already but not quite like this</p>
  
  <p>Spinner xml:</p>
  
  <pre><code>&lt;Spinner
          android:id="@+id/select_plan_spinner"
          android:layout_width="match_parent"
          android:layout_height="50dp"
          android:layout_marginLeft="10dp"
          android:layout_weight="1"
          android:background="@drawable/sos_edit_bg"
          android:gravity="center"
          android:spinnerMode="dropdown"
          android:textColor="@color/white_new"
          android:visibility="visible"&gt;&lt;/Spinner&gt;
  </code></pre>
  
  <p>Spinner:</p>
  
  <pre><code>plan_spinner = (Spinner) findViewById(R.id.select_plan_spinner);
  </code></pre>
  
  <p>plan_spinner:</p>
  
  <pre><code>plan_spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
          @Override
          public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id) {
              plan_id = PLAN_ID.get(position);
              Double price = PLAN_PRICE.get(position);
  
              planprice = price;
              Log.e("planprice", "planprice&gt;&gt;" + planprice);
  
              if (plan_id != 0) {
                  int pos = position - 1;
  
                  String view_route = feeditem.get(pos).getIMEI();
  
                  if (view_route.equals("0")) {
  
                      view_route = "No";
                  } else {
                      view_route = "yes";
                  }
  
                  desc.setText("Description: " +
                          feeditem.get(pos).getMessage() + "\n View Route History: " + view_route);
  
              } else {
  
                  desc.setText("Please select plan");
              }
          }
  
          @Override
          public void onNothingSelected(AdapterView&lt;?&gt; parent) {
  
          }
  </code></pre>
  
  <p>API:</p>
  
  <pre><code>private void Get_plan_list() {
      // TODO Auto-generated method stub
      pDialog = new ProgressDialog(Select_plan.this);
      pDialog.setMessage("Please wait...");
      pDialog.setCancelable(false);
      pDialog.show();
      StringRequest req = new StringRequest(Request.Method.POST, Config.YOUR_API_URL + "planlist",
              new Response.Listener&lt;String&gt;() {
                  @Override
                  public void onResponse(String response) {
                      pDialog.dismiss();
                      // response
                      Log.e("Responsesearch", response);
                      try {
                          JSONObject obj = new JSONObject(response);
                          int success = obj.getInt("success");
                          if (success == 1) {
                              JSONArray array = obj.getJSONArray("planlist");
                              for (int i = 0; i &lt; array.length(); i++) {
                                  JSONObject jsobj = array.getJSONObject(i);
  
                                  int p_id = jsobj.getInt("plan_id");
                                  plan_name = jsobj.getString("plan_name");
                                  planprice = jsobj.getDouble("plan_price");
                                  timeperoide = jsobj.getString("view_route");
                                  allow_devices = jsobj.getString("allowed_device");
                                  description = jsobj.getString("description");
  
                                  UserData detail = new UserData();
  
                                  detail.setID(p_id);
                                  detail.setName(plan_name);
                                  detail.setEmail(allow_devices);
                                  detail.setMessage(description);
                                  detail.setIMEI(timeperoide);
                                  detail.setMobile(String.valueOf(planprice));
  
                                  feeditem.add(detail);
  
                                  PLAN_ID.add(p_id);
                                  PLAN_PRICE.add(planprice);
                                  PLAN_NAME.add(plan_name + "( USD " + planprice + ")");
  
                                  ArrayAdapter&lt;String&gt; data2 = new ArrayAdapter&lt;String&gt;(Select_plan.this,
                                          R.layout.spinner_item, PLAN_NAME);
  
                                  plan_spinner.setAdapter(data2);
  
                                  // for auto set spinner Value
  
                                  Log.e("plan_id_intent", "plan_id_intent&gt;&gt;" + plan_id_intent);
  
  
                                  if (plan_id_intent == null) {
  
                                  } else {
                                      int position = Integer.parseInt(plan_id_intent);
                                      int index = PLAN_ID.indexOf(position);
                                      plan_spinner.setSelection(index);
                                  }
  
  
                              }
  
                          } else if (success == 0) {
                              String msg = obj.getString("text");
                              Toast.makeText(getApplicationContext(), "" + msg, Toast.LENGTH_LONG).show();
                          } else if (success == 2) {
  
                          }
  
                      } catch (JSONException e) {
                          // TODO Auto-generated catch block
                          Log.e("Error.Response", e.toString());
                          e.printStackTrace();
                      }
                  }
              },
              new Response.ErrorListener() {
                  @Override
                  public void onErrorResponse(VolleyError error) {
                      pDialog.dismiss();
  
                      // error
                      Log.e("Error.Response", error.toString());
                  }
              }
      ) {
          @Override
          protected Map&lt;String, String&gt; getParams() {
              Map&lt;String, String&gt; params = new HashMap&lt;String, String&gt;();
              return params;
          }
      };
  
      // for response time increase
      req.setRetryPolicy(new DefaultRetryPolicy(DefaultRetryPolicy.DEFAULT_TIMEOUT_MS * 2,
              DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
      req.setShouldCache(false);
      AppController.getInstance().addToRequestQueue(req);
  
  }
  </code></pre>