I am setting the background of listview items in code like this:
RelativeLayout root;
root = (RelativeLayout) convertView.findViewById(R.id.root);
root.setBackgroundColor(-14774017);
This sets the background colour correctly, but at 100% opacity. I would like to set the transparency of the relativelayout background. I understand that hex-codes can have alpha values at the start in android - eg #AARRGGBB
, but how would I add transparency to the background when I am using an integer colour value (for example -14774017
)?