I have a View
in which I am programmatically defining its width and width in this way:
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) linear.getLayoutParams();
params.height = 50;
params.width = 50;
linear.setLayoutParams(params);
However I have two devices with different resolutions, and this means that for each device, my View
has different sizes, thus defining: height = 50
.
How do I get my View
size proportional to my resolution?