I got a fragment, that should create some files, iterate through the contactbook and some other pretty long tasks. The fragment is a pretty simple "Hey, please wait" fragment with a label and a progressbar. I used factory pattern to pass arguments to this fragment.
My fragments code is comparable to the solution of this question, only with other parameters and members. In the onStart
-method I want to do my long tasks, but strangely it starts the code before I see my view, which should be created by the onCreateView
-method first, if I remember the Fragment-lifecycle correct.
Is this a side effect of Factory Pattern or what am I missing here? What would be the best solution here, so that the view is actually shown before he starts my long code execution?