Code example for SubMenu

Methods: setIcon

0
			@Override 
			protected void onPostExecute(Drawable icon)
			{ 
				if(icon != null)
				{ 
					item.setIcon(icon);
				} 
			} 
		}; 
		 
		try 
		{ 
			for(int i = 0; i < definition.length(); ++i)
			{ 
				final JSONObject item_def = definition.getJSONObject(i);
				final String text = item_def.isNull("text")? "" : item_def.getString("text");
 
				if(!item_def.has("items"))
				{ 
					MenuItem item = menu.add(0, i, i, text);
					item.setTitleCondensed(text);