I wrote code to dynamically determine the height and width of a view
view.getLayoutParams().width = 120; view.getLayoutParams().height = 120;
It works great with nougat devices, but it doesn't work with nougat. It just takes the height and width as 0. Any changes after updating nougat?
Update:
However it works
1) when I use view.requestLayout() after setting the height and width
2) view.setLayoutParams(new LinearLayout.LayoutParams(200, 120));
So why does it work with pre nougat devices without using these 2 options?
source share