I have a view (a google map), in a fragment, that takes very much of the UI thread, so i want to display the fragment with a ViewStub instead of the map view, and after the fragment is displayed, i'll inflate the viewStub layout. Like this :
ViewStub stub = (ViewStub) view.findViewById(R.id.mapViewStub);
View inflated = stub.inflate();
mMapView = (MapView) inflated.findViewById(R.id.mapView);
The problem is that i don't know where to place the code above, in order to be executed after the fragment in displayed and to be executed just once.