1

Is there a way to initialize a Fragment fully, without showing it immediately?

I have a WebView in a Fragment, but I don't want to show the Fragment until the WebView is done loading a URL. However, it seems like I'm not actually able to initialize the Fragment without displaying it?

4

2 回答 2

1

You can create a new Object of your Fragment and do Operations on it , if you do not put it on the stage with the FragmentManager.

I would recommend you to start loading the Content of the URL in a function, independent of the UI.(NOT onCreateView)

于 2013-07-10T15:59:54.130 回答
0

as workaround you can call view.setVisibility(View.INVISIBLE); before returning your View inside onCreateView.

于 2013-07-10T15:47:31.460 回答