I am using this to measure view size:
int widthMeasureSpec = View.MeasureSpec.makeMeasureSpec(toExpandVystrahy.getWidth(), View.MeasureSpec.EXACTLY);
int heightMeasureSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
textVystrahy.measure(widthMeasureSpec, heightMeasureSpec);
int vystrahyHeight = textVystrahy.getMeasuredHeight();
I have this code in my onActivityCreated
inside fragment. It works great and measures correctly when I first start my application. However when I change screen orientation and run this method from onActivityCreated
inside fragment it still returns the same value like before rotation. So where should I measure view height after screen rotation? Isnt onActivityCreated
correct place?
Thanks in forward