title: How to load Json data into a spinner in Android?
body: <p>I can get the data from the server loaded into a List&lt;>, but can't get the specific items.</p>
  
  <p>Json data looks like this.</p>
  
  <pre><code>[
      {"subscriptionType":"1234,
      "typeName":"stuff",
      "name":"Alpha"},
  
      {"subscriptionType":"1234,
      "typeName":"stuff",
      "name":"Beta"},
  ]
  </code></pre>
  
  <p>and so on...</p>
  
  <p>I have a class that that I load the data into from a Presenter calling a Fetch event. All that seems to be working because I get a Log for the data loaded into the Array</p>
  
  <pre><code>public class AppEntitySubscriptions implements Parcelable {
  
  
  public AppEntitySubscriptions(ApiSubscription apiSubscription) {
  
      this.subscriptionType = apiSubscription.getSubscriptionType();
      this.typeName = apiSubscription.getTypeName();
      this.name = apiSubscription.getName();
  }
  
  
  private int subscriptionType;
  
  private String typeName;
  
  private String name;
  
  
  public
  
  int getSubscriptionType() {
      return subscriptionType;
  }
  
  public String getTypeName() {
      return typeName;
  }
  
  public String getName() {
      return name;
  }
  
  @Override
  public int describeContents() {
      return 0;
  }
  
  @Override
  public void writeToParcel(Parcel dest, int flags) {
      dest.writeInt(this.subscriptionType);
      dest.writeString(this.typeName);
      dest.writeString(this.name);
  }
  
  @SuppressWarnings("ResourceType")
  protected AppEntitySubscriptions(Parcel in) {
      this.subscriptionType = in.readInt();
      this.typeName = in.readString();
      this.name = in.readString();
  }
  
  public static final Creator&lt;AppEntitySubscriptions&gt; CREATOR = new Creator&lt;AppEntitySubscriptions&gt;() {
      @Override
      public AppEntitySubscriptions createFromParcel(Parcel in) {
          return new AppEntitySubscriptions(in);
      }
  
      @Override
      public AppEntitySubscriptions[] newArray(int size) {
          return new AppEntitySubscriptions[size];
      }
  };
  </code></pre>
  
  <p>Now here is where I am getting lost. I just want to get the data for "name" elements into a spinner    </p>
  
  <pre><code> Spinner spinner = (Spinner) findViewById(R.id.spinner);
   List&lt;AppEntitySubscriptions&gt; userSubscriptions;//data is here
   ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.toolbar_spinner_item, "what goes here"???);
      adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
      spinner.setAdapter(adapter);
  </code></pre>
  
  <p>I don't know how to get the name into a string array of it's own and loaded into the spinner. Any suggestions would be helpful.</p>
  
  <p>Thanks.</p>