title: Slow loading of layout
body: <p>I have a super class which is in a library. This library take care of initializing some basic layout components and other stuff. My problem is that it takes 1.x seconds to load the layout, and shows the default layout for a while, before setting the child-specified layout. </p>
  
  <p>This is the method of my super class:</p>
  
  <pre><code>public void InitializeWindow(Activity act, int layoutResourceId, String windowTitle,
          Object menuAdapter, int slideMenuMode) {
      super.setContentView(layoutResourceId);
      super.setBehindContentView(R.layout.menu_frame);
      this.menuAdapter = menuAdapter; 
      this.slideMenuMode = slideMenuMode;
      setWindowTitle(windowTitle);
      initializeSlidingMenu();
  }
  </code></pre>
  
  <p>This is called this way:</p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      super.InitializeWindow(this, R.layout.activity_home, "\t\tHome",
              new MenuAdapter(this, R.menu.slide_menu), SlidingMenu.TOUCHMODE_FULLSCREEN);    
  }
  </code></pre>
  
  <p>The application works like a charm, but it takes, as I said around 1.x seconds to load the layout passed from the child-class. Why does this happen? </p>
  
  <p>By request, this is my <code>initializeSlideMenu()</code> method:</p>
  
  <pre><code>public void initializeSlidingMenu() {
      this.setSlidingActionBarEnabled(true);
      getSlidingMenu().setBehindOffsetRes(R.dimen.actionbar_home_width);
      getSlidingMenu().setShadowWidthRes(R.dimen.shadow_width);
      getSlidingMenu().setShadowDrawable(R.drawable.shadow);
      getSlidingMenu().setTouchModeAbove(slideMenuMode);
      getSlidingMenu().setBehindScrollScale(0.25f);
  
      ListView v = new ListView(this);
      v.setBackgroundColor(Color.parseColor("#000000"));
      v.setAdapter((ListAdapter) menuAdapter);
      getSlidingMenu().setMenu(v);
  }
  </code></pre>