I created a SimpleAdapter and I am using that for my ListView.

Here is what I did:

JavaList<IDictionary<string, object>> menuItemNames = new JavaList<IDictionary<string, object>> ();

JavaDictionary<string, object> sideItem1 = new JavaDictionary<string, object> ();
sideItem1.Add ("text", "Home");
sideItem1.Add ("icon", Resource.Drawable.menu_icon_home);

JavaDictionary<string, object> sideItem2 = new JavaDictionary<string, object> ();
sideItem2.Add ("text", "Sign Out");
sideItem2.Add ("icon", Resource.Drawable.menu_icon_signOut);

JavaDictionary<string, object> sideItem3 = new JavaDictionary<string, object> ();
sideItem3.Add ("text", "Help");
sideItem3.Add ("icon", Resource.Drawable.menu_icon_help);

menuItemNames.Add (sideItem1);
menuItemNames.Add (sideItem2);
menuItemNames.Add (sideItem3);

string[] sideMenuFromArr = { "text", "icon" };
int[] sideMenuToArr = { Resource.Id.textSideMenuItem, Resource.Id.imgViewSideMenuItemIcon };

// this is where I created the adaper
SimpleAdapter sideMenuListAdapter = new SimpleAdapter (context, menuItemNames, Resource.Layout.item_menu, sideMenuFromArr, sideMenuToArr);

After this, I just applied this list to my ListView.

this.absHomeSideMenuList.Adapter = sideMenuListAdapter;

If I want to disable one of the item at some point, what would I do?
I want to keep it in the list but remove the click event AND change the text color to gray to make it look disabled?

Related posts

Recent Viewed