title: Show the Elements from ArrayList of map ,in list form in Android
body: <p>I have a A data stored in <strong>ArrayList&lt; HashMap&lt; String, String> ></strong> retrieved from JSON 
  in the form (i.e.)</p>
  
  <pre><code>[{price: =1685 name: =Monographie Der Gattung Pezomachus (Grv.) by Arnold F.    Rster}]
  </code></pre>
  
  <p>And I need to show the all map elements into list form in Android.
  I've tried many ways but I'm unable to do it .</p>
  
  <p>Also help me to know about the layouts to use in it</p>
  
  <p>EDITED:</p>
  
  <pre><code>MySimpleArrayAdapter adapter = new MySimpleArrayAdapter(myarr_list);
  setListAdapter(adapter);
  </code></pre>
  
  <p>And in the MySimpleArrayAdapter Class, in Constructor</p>
  
  <pre><code>public MySimpleArrayAdapter( ArrayList&lt;HashMap&lt;String,String&gt;&gt; pl) {
  LayoutInflator inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  }
  </code></pre>
  
  <p>The control does not proceed after this,
  MySimpleArrayAdapter Class </p>
  
  <pre><code>public class MySimpleArrayAdapter extends BaseAdapter{
      ArrayList&lt;HashMap&lt;String, String&gt;&gt; ProductList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
      LayoutInflater inflater;
  
      @Override
      public int getCount() {
          // TODO Auto-generated method stub
          return 0;
      }
  
      @Override
      public Object getItem(int position) {
          // TODO Auto-generated method stub
          return null;
      }
  
      @Override
      public long getItemId(int position) {
          // TODO Auto-generated method stub
          return 0;
      }
  
  
      //Constructor
      public MySimpleArrayAdapter( ArrayList&lt;HashMap&lt;String,String&gt;&gt; pl) {
  
          this.ProductList = pl;
          inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
      }
  
  
  
  
  
      public View getView(int position, View convertView, ViewGroup parent) {
  
          View myview = convertView;
  
          if (convertView == null) {
              myview = inflater.inflate(R.layout.show_search_result, null);
          }
  
  
          TextView price = (TextView) myview.findViewById(R.id.price);
          TextView name = (TextView) myview.findViewById(R.id.name);
  
  
  
          HashMap&lt;String, String&gt; pl = new HashMap&lt;String, String&gt;();
          pl = ProductList.get(position);
          //Setting 
          price.setText(pl.get("price"));
          name.setText(pl.get("name"));
          return myview;
  
      }
  
  
  }
  </code></pre>
  
  <p>I am editing here a onPostExecute class from  SearchResultsTask extended by  AsyncTask</p>
  
  <pre><code>protected void onPostExecute(JSONObject json) {
  
              if (json != null &amp;&amp; json.length() &gt; 0) {
                  try {                   
                  JSONArray json_results = (JSONArray)(json.get("results"));               
                  String parsedResult = "";
                  System.out.println("-&gt; Size ="+ json_results.length());
  
  
                      for(int i = 0; i &lt; json_results.length(); i++){         
                          HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
                          JSONObject json_i = json_results.getJSONObject(i);
  
  
                          map.put("name: ",json_i.getString("name") + "\n");
                          map.put("price: ",json_i.getString("price") + "\n");    
                          arr_list.add(map);
  
                      }                        
                  } catch (JSONException e) {
                      e.printStackTrace();
                  }
              }
              System.out.println("-&gt; Size =====arr_llist ="+ arr_list.size());
          //  CustomListAdapter adapter = new CustomListAdapter (arr_list);
              //final StableArrayAdapter adapter = new StableArrayAdapter(this, R.id.result, arr_list);
          //  listview.setAdapter(adapter);
              MyListActivity obj1 = new MyListActivity();
              Bundle icicle = null;
              obj1.onCreate(icicle); 
  
  
          }
      public class MyListActivity extends Activity {
  
            public void onCreate(Bundle icicle) {
              //  System.out.println("In my list Activity");
              // super.onCreate(icicle);
  
              //populate list
             MySimpleArrayAdapter adapter = new MySimpleArrayAdapter(this,arr_list);
              //  System.out.println("in 2");
  
             adapter.getView(0, listview, listview);
             listview.setAdapter(adapter);
            }
  
  
      }
  </code></pre>