populate a textview from an already inflated layout with a Hashmap
<p>Good day, Hope title is not confusing and i can be clear here. I have a custom ArrayAdapter with TextViews and ImageViews. now i want one of the TextView to be populated by values from a HashMap which have the 2nd columns as the Keys. the structure is just like this..</p>

<p>image1  shop  text2</p>

<p>image2  cars  text2</p>

<p>image3  House text2</p>

<p>image4  boats text2</p>

<p>In this example, the 1st and 2nd columns have already been populated with arrays in the ArrayAdapter. so i want the text2, to be populated with a HashMap of values of which column2 are the keys. an example is, if there are 30 shops, we will have</p>

<p>image1 shop 30 </p>

<p>code is :</p>

<pre><code>    Resources rsc = getActivity().getResources();
        String[] options = rsc.getStringArray(R.array.item_title);
        TypedArray icons = rsc.obtainTypedArray(R.array.item_title_color);
  HashMap&lt;String,String&gt; map = new HashMap&lt;String,String&gt;();

    MyAdapter adapter = new MyAdapter(getActivity(), R.layout.listview_custom_item, options, icons, map);
        list.setAdapter(adapter);
</code></pre>

<p>MyAdapter class:</p>

<pre><code>class MyAccountsAdapter extends ArrayAdapter&lt;Object&gt; {
        private LayoutInflater mInflater;
        private int ViewResourceId; 
        private String[] mstring;
        TypedArray icons;
        HashMap&lt;String, String&gt; infomap = new HashMap&lt;String,String&gt;();

    public MyAdapter(Context context, int textViewResourceId, String[] string, TypedArray icons, HashMap&lt;String, String&gt; map) {
            super(context, textViewResourceId, string);

      mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              mstring = string;
              this.icons = icons;
              ViewResourceId = textViewResourceId;
              infomap.putAll(map);  //another hashmap here
        }

    @Override
        public int getCount(){
            return mstring.length;
        }

            @Override
        public View getView(int position, View convertView, ViewGroup parent){
            convertView = mInflater.inflate(ViewResourceId, null);

            ImageView imageview = (ImageView)convertView.findViewById(R.id.list_image_id);
            TextView text_title = (TextView)convertView.findViewById(R.id.list_text_id);
            TextView text_info = (TextView)convertView.findViewById(R.id.list_textinfo_id);

            imageview.setImageDrawable(icons.getDrawable(position));
            text_title.setText(mstring[position]);
            Log.d(TAG, "strings are" + text_title.getText().toString());

// so how do i populate text_info here to correspond with text_title;

            return convertView;
        }
</code></pre>

<p>any ideas? or is there a better way to do this like combine them all into one?..  any help is highly appreciated. Thank you</p>
