why
TableRow.LayoutParams layout = new TableRow.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, 1/11);
does not work but
String s = "0.0909";
float fVal = Float.valueOf(s).floatValue();
TableRow.LayoutParams layout = new TableRow.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, fVal);
does?
I use this to make table rows fit in a table with dynamic table width.
Regards
1/11is an int (which happens to be 0), because both1and11are integers.Try
1.0f / 11instead to get a float value (or1f / 11but I find it less readable).