I have an ImageView and I want to change it's size in runtime. So I do the following:
LayoutParams params = (LayoutParams) imgView.getLayoutParams();
params.width = size;
params.height = size
imgView.setLayoutParams(params);
The problem is that based on these new width and height I want to change my another ImageView, but seems like LayoutParams are not applied immedately, because Log put just after setLayoutParams prints old width value. So here is a question: is there any way to force ImageView to update (I already tried View.invalidate()
and View.requestLayout
but no success), or is there any way to detect if ImageView has finished updating, so I can use it's new parameters?