For the Android source Activity.java .
Specifically, the setContentView() method on line 1646:
public void setContentView(int layoutResID) { getWindow().setContentView(layoutResID); }
I would like to know what exactly it causes / does.
Here is my trace ...
On line 642, we know that it is the type android.view.Window
private Window mWindow;
But Window.java is an abstract class. And on line 738, the method is also abstract:
public abstract void setContentView(int layoutResID);
Where is the real body of the function realized?
Back to the Activity.java file, on line 3746 we find some mWindow initializations:
mWindow = PolicyManager.makeNewWindow(this); mWindow.setCallback(this); ...
Well, about com.android.internal.policy.PolicyManager makeNewWindow() :
public static Window makeNewWindow(Context context) { return sPolicy.makeNewWindow(context); }
and
private static final IPolicy sPolicy; Class policyClass = Class.forName(POLICY_IMPL_CLASS_NAME); sPolicy = (IPolicy)policyClass.newInstance();
IPolicy.java is an interface, which means no implementation at all.
My footprint cannot go further. Could you help me?
In particular, I know that Activity.setContentView() will eventually call android.support.v4.app.Fragment.java Fragment.onInflate() - line 920, Fragment.onAttach() - line 928, Fragment.onCreate() - line 953, Fragment.onCreateView() - line 967 and Fragment.onViewCreated() - line 991.