title: How to display Map values in ListView?
body: <p>I am trying to display the <code>Map</code> values in ListView using BaseAdapter. Using the below code I am able to successfully print all the values in <code>Map</code>. But i don't know <strong>how to display a single value of <code>Map</code> using its key</strong>. </p>
  
  <p><strong>MyContactAdapter2.java</strong></p>
  
  <pre><code>public class MyContactAdapter2 extends BaseAdapter {
      List&lt;EffectList&gt; contacts;
      Context context;
      private LayoutInflater mInflater;
  
  
  
      // Constructors
      public MyContactAdapter2(Context context, List&lt;Map&lt;String, List&lt;EffectList&gt;&gt;&gt; objects) {
  
          this.context = context;
          this.mInflater = LayoutInflater.from(context);
  
          this.contacts = new ArrayList&lt;&gt;();
          Map&lt;String, List&lt;EffectList&gt;&gt; map = objects.get(0);
          Set&lt;String&gt; keySet = map.keySet();
          Iterator&lt;String&gt; iterator = keySet.iterator();
          while (iterator.hasNext()) {
              this.contacts.addAll(map.get(iterator.next()));
  
          }
  
      }
  
  
      @Override
      public int getCount() {
          int count = contacts.size();
          return count;
      }
  
      @Override
      public EffectList getItem(int position) {
          return contacts.get(position);
      }
  
  
      @Override
      public long getItemId(int position) {
          return 0;
      }
  
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
  
  
          final MyContactAdapter2.ViewHolder vh;
          if (convertView == null) {
              View view = mInflater.inflate(R.layout.get_layout_row_view, parent, false);
              vh = MyContactAdapter2.ViewHolder.create((RelativeLayout) view);
              view.setTag(vh);
  
          } else {
              vh = (MyContactAdapter2.ViewHolder) convertView.getTag();
          }
          EffectList item = getItem(position);
  
          vh.textViewName.setText(item.getEffectsId());
          vh.textViewEmail.setText(item.getEffectsName());
  
  
          return vh.rootView;
      }
  
  
      private static class ViewHolder {
          public final RelativeLayout rootView;
          public final ImageView imageView;
          public final TextView textViewName;
          public final TextView textViewEmail;
  
          private ViewHolder(RelativeLayout rootView, ImageView imageView, TextView textViewName, TextView textViewEmail) {
              this.rootView = rootView;
              this.imageView = imageView;
              this.textViewName = textViewName;
              this.textViewEmail = textViewEmail;
          }
  
          public static MyContactAdapter2.ViewHolder create(RelativeLayout rootView) {
              ImageView imageView = (ImageView) rootView.findViewById(R.id.imageView);
              TextView textViewName = (TextView) rootView.findViewById(R.id.textViewName);
              TextView textViewEmail = (TextView) rootView.findViewById(R.id.textViewEmail);
              return new MyContactAdapter2.ViewHolder(rootView, imageView, textViewName, textViewEmail);
          }
      }
  }
  </code></pre>
  
  <p>This is the Json I need to parse,</p>
  
  <pre><code> {
      "effect_list": [{
            "1":[  
               {  
                  "effects_id":"1",
                  "effects_name":"Band 1"
               },
               {  
                  "effects_id":"2",
                  "effects_name":"Band 2"
               }
  
  
            ],
            "2": [ 
               {  
                  "effects_id":"4",
                  "effects_name":"Background Blur"
               },
               {  
                  "effects_id":"5",
                  "effects_name":"Blemish Removal"
               }
            ] 
         }]
      }
  </code></pre>
  
  <p>I want to display only the values of "1" <strong>("effects_id":"1","effects_name":"Band 1" and "effects_id":"2","effects_name":"Band 2")</strong>. How can I achieve it?</p>
  
  <p>I am confused with the code inside constructor too. If you can,Please explain the following code,</p>
  
  <pre><code>this.contacts = new ArrayList&lt;&gt;();
          Map&lt;String, List&lt;EffectList&gt;&gt; map = objects.get(0);
          Set&lt;String&gt; keySet = map.keySet();
          Iterator&lt;String&gt; iterator = keySet.iterator();
          while (iterator.hasNext()) {
              this.contacts.addAll(map.get(iterator.next()));
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>EffectList.java </p>
  
  <pre><code>public class EffectList {
  
  
  
      @SerializedName("effects_id")
      @Expose
      private String effectsId;
  
      @SerializedName("effects_name")
      @Expose
      private String effectsName;
  
      public String getEffectsId() {
          return effectsId;
      }
  
   /*   public void setEffectsId(String effectsId) {
          this.effectsId = effectsId;
      }
  */
  
      public String getEffectsName() {
          return effectsName;
      }
  /*
      public void setEffectsName(String effectsName) {
          this.effectsName = effectsName;
      }
      */
  }
  </code></pre>