title: JSON not Displaying content in Spinner
body: <p>I encountered a problem. I do not understand where my code is wrong, I have 4 spinners, all of them display the same JSON file. All four things are the same. But only one of them does not show anything. In your opinion, where is the problem with this code? </p>
  
  <p>The <code>URL_AllUniversity</code> Work Correctly. But I do not understand what the problem is...
  Also better to give you a Screen of what I See: 
  <a href="https://i.stack.imgur.com/1fV4t.jpg" rel="nofollow noreferrer">enter image description here</a>
  And, this is my <code>University</code> URL
  <a href="https://i.stack.imgur.com/rbFWN.jpg" rel="nofollow noreferrer">enter image description here</a></p>
  
  <pre><code>[ { "University": "دانشگاه آيت ا... العظمي حائري ميبد" }, { "University": "دانشگاه اراک" }, { "University": "دانشگاه اردکان" }, { "University": "دانشگاه اروميه" }, { "University": "دانشگاه اصفهان" }, { "University": "دانشگاه الزهرا(س)" },...
  </code></pre>
  
  <p>This is my Java Code:</p>
  
  <pre><code>    public class FormActivity extends AppCompatActivity {
  
  Spinner spinnerStudy,spinnerUnited,spinnerCity,spinnerUniversity;
  ArrayList&lt;String&gt; AllStudy,AllUnited,AllCity, AllUniversity;
  
  String URL_AllStudy = "http://192.168.1.103/android_login_api/helper/AllStudy.json";
  String URL_AllUnited = "http://192.168.1.103/android_login_api/helper/AllUnited.json";
  String URL_AllCity = "http://192.168.1.103/android_login_api/helper/AllCity.json";
  String URL_AllUniversity = "http://192.168.1.103/android_login_api/helper/AllUniversity.json";
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_form);
  
      AllStudy = new ArrayList&lt;&gt;();
      AllUnited = new ArrayList&lt;&gt;();
      AllUniversity = new ArrayList&lt;&gt;();
      AllCity = new ArrayList&lt;&gt;();
  
  
      spinnerStudy = findViewById(R.id.spinner_AllStudy);
      spinnerUnited = findViewById(R.id.spinner_AllUnited);
      spinnerUniversity = findViewById(R.id.spinner_AllUniversity);
      spinnerCity = findViewById(R.id.spinner_AllCity);
  
  
      loadSpinnerDataStudy(URL_AllStudy);
      loadSpinnerDataUnited(URL_AllUnited);
      loadSpinnerDataUniversity(URL_AllUniversity);
      loadSpinnerDataCity(URL_AllCity);
  
  
      spinnerStudy.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
  
      @Override
      public void onItemSelected(AdapterView&lt;?&gt; adapterView, View view, int i, long l) {
  
  
          String all_study =  spinnerStudy.getItemAtPosition(spinnerStudy.getSelectedItemPosition()).toString();
  
  
          Toast.makeText(getApplicationContext(),all_study, Toast.LENGTH_SHORT).show();
  
      }
  
      @Override
      public void onNothingSelected(AdapterView&lt;?&gt; adapterView) {
          // DO Nothing here
      }
      });
  
      spinnerCity.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
  
          @Override
          public void onItemSelected(AdapterView&lt;?&gt; adapterView, View view, int i, long l) {
  
  
              String all_city =  spinnerCity.getItemAtPosition(spinnerCity.getSelectedItemPosition()).toString();
  
  
  
              Toast.makeText(getApplicationContext(),all_city, Toast.LENGTH_SHORT).show();
  
          }
  
          @Override
          public void onNothingSelected(AdapterView&lt;?&gt; adapterView) {
              // DO Nothing here
          }
      });
  
      spinnerUniversity.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
  
          @Override
          public void onItemSelected(AdapterView&lt;?&gt; adapterView, View view, int i, long l) {
  
  
              String all_university =  spinnerUniversity.getItemAtPosition(spinnerUniversity.getSelectedItemPosition()).toString();
  
              Toast.makeText(getApplicationContext(),all_university, Toast.LENGTH_SHORT).show();
  
          }
  
          @Override
          public void onNothingSelected(AdapterView&lt;?&gt; adapterView) {
              // DO Nothing here
          }
      });
  
      spinnerUnited.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
  
          @Override
          public void onItemSelected(AdapterView&lt;?&gt; adapterView, View view, int i, long l) {
  
  
              String all_united =  spinnerUnited.getItemAtPosition(spinnerUnited.getSelectedItemPosition()).toString();
  
              Toast.makeText(getApplicationContext(),all_united, Toast.LENGTH_SHORT).show();
  
          }
  
          @Override
          public void onNothingSelected(AdapterView&lt;?&gt; adapterView) {
              // DO Nothing here
          }
      });
  
  
  }
  
  
  
  
  private void loadSpinnerDataUnited(String URL_AllUnited) {
  
  
      RequestQueue requestQueue = Volley.newRequestQueue(getApplicationContext());
      StringRequest stringRequest = new StringRequest(Request.Method.GET, URL_AllUnited, new Response.Listener&lt;String&gt;() {
  
  
          @Override
          public void onResponse(String response) {
  
  
              try {
  
                  ArrayList&lt;String&gt; AllUnited = new ArrayList&lt;&gt;();
                  JSONArray jsonarray = new JSONArray(response);
  
                  for (int i = 0; i &lt; jsonarray.length(); i++) {
                      JSONObject jsonobject = jsonarray.getJSONObject(i);
                      AllUnited.add(new String(jsonobject.getString("United").getBytes("ISO-8859-1"), "UTF-8"));
  
  
                  }
                  spinnerUnited.setAdapter(new ArrayAdapter&lt;&gt;(FormActivity.this,
                          android.R.layout.simple_spinner_dropdown_item, AllUnited));
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
  
      }, new Response.ErrorListener() {
          @Override
          public void onErrorResponse(VolleyError error) {
              error.printStackTrace();
          }
  
      });
  
      int socketTimeout = 30000;
      RetryPolicy policy = new DefaultRetryPolicy(socketTimeout, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
      stringRequest.setRetryPolicy(policy);
      requestQueue.add(stringRequest);
  }
  
      private void loadSpinnerDataCity (String URL_AllCity) {
  
  
      RequestQueue requestQueue = Volley.newRequestQueue(getApplicationContext());
      StringRequest stringRequest = new StringRequest(Request.Method.GET, URL_AllCity, new Response.Listener&lt;String&gt;() {
  
  
          @Override
          public void onResponse(String response) {
  
  
              try {
  
                  ArrayList&lt;String&gt; AllCity = new ArrayList&lt;&gt;();
                  JSONArray jsonarray = new JSONArray(response);
  
                  for (int i = 0; i &lt; jsonarray.length(); i++) {
                      JSONObject jsonobject = jsonarray.getJSONObject(i);
                      AllCity.add(new String(jsonobject.getString("City").getBytes("ISO-8859-1"), "UTF-8"));
  
  
                  }
                  spinnerCity.setAdapter(new ArrayAdapter&lt;&gt;(FormActivity.this,
                          android.R.layout.simple_spinner_dropdown_item, AllCity));
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
  
      }, new Response.ErrorListener() {
          @Override
          public void onErrorResponse(VolleyError error) {
              error.printStackTrace();
          }
  
      });
  
      int socketTimeout = 30000;
      RetryPolicy policy = new DefaultRetryPolicy(socketTimeout, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
      stringRequest.setRetryPolicy(policy);
      requestQueue.add(stringRequest);
  }
  
  private void loadSpinnerDataUniversity (String URL_AllUniversity) {
      RequestQueue requestQueue = Volley.newRequestQueue(getApplicationContext());
      StringRequest stringRequest = new StringRequest(Request.Method.GET, URL_AllUniversity, new Response.Listener&lt;String&gt;() {
  
  
          @Override
          public void onResponse(String response) {
  
  
              try {
  
  
                  ArrayList&lt;String&gt; AllUniversity = new ArrayList&lt;&gt;();
                  JSONArray jsonarray = new JSONArray(response);
  
                  for (int i = 0; i &lt; jsonarray.length(); i++) {
                      JSONObject jsonobject = jsonarray.getJSONObject(i);
                      AllUniversity.add(new String(jsonobject.getString("University").getBytes("ISO-8859-1"), "UTF-8"));
  
                      Toast.makeText(FormActivity.this,response,Toast.LENGTH_SHORT);
                  }
                  spinnerUniversity.setAdapter(new ArrayAdapter&lt;&gt;(FormActivity.this,
                          android.R.layout.simple_spinner_dropdown_item, AllUniversity));
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
  
      }, new Response.ErrorListener() {
          @Override
          public void onErrorResponse(VolleyError error) {
              error.printStackTrace();
          }
  
      });
  
      int socketTimeout = 30000;
      RetryPolicy policy = new DefaultRetryPolicy(socketTimeout, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
      stringRequest.setRetryPolicy(policy);
      requestQueue.add(stringRequest);
  }
  
  private void loadSpinnerDataStudy(String URL_AllStudy) {
  
  
          RequestQueue requestQueue = Volley.newRequestQueue(getApplicationContext());
          StringRequest stringRequest = new StringRequest(Request.Method.GET, URL_AllStudy, new Response.Listener&lt;String&gt;() {
  
  
              @Override
              public void onResponse(String response) {
  
  
                  try {
  
                      ArrayList&lt;String&gt; AllStudy = new ArrayList&lt;&gt;();
                      JSONArray jsonarray = new JSONArray(response);
  
                      for (int i = 0; i &lt; jsonarray.length(); i++) {
                          JSONObject jsonobject = jsonarray.getJSONObject(i);
                          AllStudy.add(new String(jsonobject.getString("Study").getBytes("ISO-8859-1"), "UTF-8"));
  
  
                      }
                      spinnerStudy.setAdapter(new ArrayAdapter&lt;&gt;(FormActivity.this,
                              android.R.layout.simple_spinner_dropdown_item, AllStudy));
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
              }
  
          }, new Response.ErrorListener() {
              @Override
              public void onErrorResponse(VolleyError error) {
                  error.printStackTrace();
              }
  
          });
  
          int socketTimeout = 30000;
          RetryPolicy policy = new DefaultRetryPolicy(socketTimeout, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
          stringRequest.setRetryPolicy(policy);
          requestQueue.add(stringRequest);
  }
  
  }
  </code></pre>