I have a list of objects, I set them to view and insert to layout
But I don't know how to identify which view for which object
Is it possible to add additional attribute to view before I insert it to layout?
For example:
LayoutInflater inflater=LayoutInflater.from(this);
HashMap<String, String> hm=new HashMap<String, String>();
hm.put("key1", "value 1");
hm.put("key2", "value 2");
hm.put("key3", "value 3");
for(String key: hm.keySet())
{
View oneItem=inflater.inflate(R.layout.oneItem, linearlayout, false);
TextView tv=(TextView)oneItem.findViewById(R.id.value);
tv.setText(hm.get(key));
//Is there any something like this?
//oneItem.putExtra("id", key);
//oneItem.setAttribute("id", key);
linearlayout.addView(oneItem);
}