title: How can i set Hashmap data into listview in android?
body: <p>I have generic hashmap. I need to fill all the items of hashmap into listview.What is the adapter class.</p>
  
  <p>Here, is my adapter class</p>
  
  <pre><code>package com.domore.settextviewdynamically;
  import android.content.Context;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.BaseAdapter;
  import android.widget.TextView;
  
  import java.util.ArrayList;
  import java.util.HashMap;
  import java.util.Map;
  /**
   * Created by MY WORLD on 1/11/2016.
   */
  public class MyAdpter extends BaseAdapter {
      private final ArrayList mData;
  
  //    ArrayList&lt;HashMap&lt;String,String&gt;&gt; map;
      private Context context;
      private LayoutInflater inflater;
      public MyAdpter(Context context,HashMap&lt;String,String&gt; map) {
          mData = new ArrayList();
          mData.addAll(map.entrySet());
  //        this.map=map;
      }
  
      @Override
      public int getCount() {
          return mData.size();
      }
  
      @Override
      public Map.Entry&lt;String,String&gt; getItem(int position) {
          return (Map.Entry) mData.get(position);
      }
  
      @Override
      public long getItemId(int position) {
          return position;
      }
      public class Holder{
          TextView overs;
          TextView balls;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          final View result;
  
          if (convertView == null) {
              result = LayoutInflater.from(parent.getContext()).inflate(R.layout.my_adapter_item, parent, false);
          } else {
              result = convertView;
          }
  
          Map.Entry&lt;String, String&gt; item = getItem(position);
  
          ((TextView) result.findViewById(R.id.overs)).setText(item.getKey());
          ((TextView) result.findViewById(R.id.balls)).setText(item.getValue());
  
          return result;
      }
  }
  </code></pre>
  
  <p>Here is the code which i call my adapter</p>
  
  <pre><code>adapter=new MyAdpter(this,hashMap);
  lst.setAdapter(adapter);
  </code></pre>
  
  <p>Please, help me to solve out this problem.
  I got only last element of hashmap.</p>