I am trying to create a PDF of a nested linear layout with a table layout. My problem is that my initial attempts led to a file being drawn without the complete view.
To get around this I decided to only write to the file after the view is done loading and I tried to listen for the event using the ViewTreeObserver.globalOnLayoutListener
but it never got evoked. So I decided to use View.post()
and it too doesn't seem to work.
I have waited 4 minutes thinking it may take a while to draw since the layout file is large but the listener, and later on the runnable were never called. I verified the facts using both breakpoints, and logcat.
Where am I going wrong?