I'm inflating a ViewGroup for export into a PDF document. After inflating it from xml file I am filling it with images and texts. Now when I try to draw this ViewGroup in the canvas of a PDF page, the height of the VieGroup is zero. And the canvas is empty.
This is the code:
View pdfRowLayout = ltInflater.inflate(R.layout.pdf_export_row_layout,
(ViewGroup) parent, false);
TextView action = (TextView) pdfRowLayout.findViewById(R.id.pdf_action_field);
action.setText(host.getDataProvider().getChildItem(curGroupPosition, 1).getText());
ImageView avatar = (ImageView) pdfRowLayout.findViewById(R.id.pdf_avatar);
avatar.setImageBitmap(host.getDataProvider().getGroupItem(curGroupPosition).getGroupImage());
I understand that I need to wait till the layout is fully inflated with a specific listener. But do I have to wait somehow for all the data to get in resizing the layout?