1 //use a GradientDrawable with only one color set, to make it a solid color
2 GradientDrawable border = new GradientDrawable();
3 border.setColor(0xFFFFFFFF); //white background
4 border.setStroke(1, 0xFF000000); //black border with full opacity
5 if(Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
6 TitleLayout.setBackgroundDrawable(border);
7 } else {
8 TitleLayout.setBackground(border);
9 }