Sometimes when I change a View
in some way I don't get the correct dimensions after I change it.
Let's take for example a TextView
that is single lined to true:
txv.setSingleLine(true)
Then I change it to false, let's say by clicking of a button:
txv.setSingleLine(false)
After that I call:
txv.invalidate()
But then I call:
int sizeH = txv.getHeight()
But I don't get the correct size after that. I still have the size of when the View
was setSingleLine(true)
.
So at what time is it correct or safe to get the view dimensions I just had changed?