I need to load only the second item's image from a URL. I've searched for libraries and methods to make lists with URL images and text, but i only need the second item's image to be loaded.
public void prepareArrayLits()
{
menuItemList = new ArrayList<Object>();
AddObjectToList(R.drawable.icon_door, "Pet Open");
AddObjectToList(R.drawable.icon_profile_small, GlobalData.fullname);
AddObjectToList(R.drawable.icon_messages, "Messages");
AddObjectToList(R.drawable.icon_people, "People");
AddObjectToList(R.drawable.icon_settings, "Settings");
AddObjectToList(R.drawable.icon_logout, "Log Out");
}
I wouldn't like to change the adapter, so what if i could change the second item's image after the list was made. Is there any way i could do this?
other items images' from list cannot be loaded from url
@Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return menuItemList.get(position);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
ViewHolder holder;
if(convertView==null)
{
holder = new ViewHolder();
convertView = inflater.inflate(R.layout.menu_drawer_left, null);
holder.listMenuIcon = (ImageView) convertView.findViewById(R.id.ic_menu);
holder.listMenuText = (TextView) convertView.findViewById(R.id.txt_menu);
convertView.setTag(holder);
}
else
holder=(ViewHolder)convertView.getTag();
MenuItemBean bean = (MenuItemBean) menuItemList.get(position);
holder.listMenuIcon.setImageResource(bean.getMenuIcon());
holder.listMenuText.setText(bean.getMenuText());
return convertView;
}
If the count starts from 0, i would like to change the item with id 1. How do i change it?