How to wait for the render elements plug-in using addView()?

The point is simple, insert into block elements using addView, and after trying to measure their size using getWidth(), which returns 0, but if you call getWidth() through pressing for example the button have respectively after drawing size gets as it should, the conclusion is that elements simply do not have time to render in the time of the request, I think there should be some kind of colback or trick of some sort, unfortunately the search in the documentation and Google didn't give any reasonable explanations.
July 9th 19 at 13:12
1 answer
July 9th 19 at 13:14
A huge thank you! who would have thought, so many hours of searching, and one seemingly insignificant line, I had found the solution about getMeasuredWidth() but it also gave 0 as there was not enough before the query, just add the view.measure(0, 0) - Bo_Wo commented on July 9th 19 at 13:17
Please) - mercedes commented on July 9th 19 at 13:20

Find more questions by tags Android