title: Android display data from json to spinner and textview
body: <p>Hello everybody I want to display data from my server and display theme on my spinner and text view. So far what I've tried is displaying them on my spinner. But I don't have a clue how to display them on textview.</p>
  
  <p>This is what I've tried so far:</p>
  
  <pre><code>private ArrayList&lt;Verse&gt; versesList;
  versesList = new ArrayList&lt;Verse&gt;();
  
  // DownloadJSON AsyncTask
  private class DownloadJSON extends AsyncTask&lt;Void, Void, Void&gt; {
  
  @Override
  protected void onPreExecute() {
          super.onPreExecute();
          // Create a progressdialog
          mProgressDialog = new ProgressDialog(ALARM.this);
          // Set progressdialog title
          mProgressDialog.setTitle("Downloading Verses");
          // Set progressdialog message
          mProgressDialog.setMessage("Loading...");
          mProgressDialog.setIndeterminate(false);
          // Show progressdialog
          mProgressDialog.show();
  }
  
  @Override
  protected Void doInBackground(Void... params) {
          // Create the array 
          // Retrieve JSON Objects from the given website URL in JSONfunctions.class
  
          ServiceHandler jsonParser = new ServiceHandler();
          String result;
  
          lang = Locale.getDefault().getLanguage();
  
          if(lang.equals("en")){
              result = jsonParser.makeServiceCall(URLENGLISH, ServiceHandler.GET);
          } else  {
              result = jsonParser.makeServiceCall(URLTAGALOG, ServiceHandler.GET);
          }
  
  
          try {
              JSONArray jr = new JSONArray(result);
  
              Log.d("Response: ", "&gt; " + result);
  
              for (int i = 0; i &lt; jr.length(); i++) {
                  JSONObject catObj = jr.getJSONObject(i); //(JSONObject) jr.get(i);
                  Verse cat = new Verse(catObj.getInt("verse_id"), 
                          catObj.getString("verse_title"));
  
                      versesList.add(cat);
  
              }
          } catch (JSONException e) {
              Log.e("Error", e.getMessage());
              e.printStackTrace();
          }
          return null;
  } 
  
  @Override
  protected void onPostExecute(Void args) {
          // Close the progressdialog
          if (mProgressDialog.isShowing())
              mProgressDialog.dismiss();
          populateSpinner();
      }
  }
  
  /**
   * Adding spinner data
   * */
  private void populateSpinner() {
      List&lt;String&gt; lables = new ArrayList&lt;String&gt;();
  
      for (int i = 0; i &lt; versesList.size(); i++) {
          lables.add(versesList.get(i).getName());
      }
  
      // Creating adapter for spinner
      ArrayAdapter&lt;String&gt; spinnerAdapter = new ArrayAdapter&lt;String&gt;(this,
              android.R.layout.simple_spinner_item, lables);
  
      // Drop down layout style - list view with radio button
      spinnerAdapter
              .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  
      // attaching data adapter to spinner
      spinner.setAdapter(spinnerAdapter);
  }
  </code></pre>
  
  <p>Does anybody know how to achieve this? Your help will be greatly appreciated. Thanks.</p>