title: App needs long time to Start with a BlackScreen
body: <p>i have a big Problem, my app needs nearly 3 seconds to start/open. In this 3sec i only see a black screen.
  I know some issues for this Black-Screen but they are all not the Problem.</p>
  
  <p>I run the traceview and i see that the onCreate needs more than 2seconds. Than i go deeper and see, that addTab of the TabHost needs more than 2sec.</p>
  
  <p>Is addTab also calls the onCreate of each Activity of each Tab??
  I also have a Custom_title_bar, but after removing the custom_title it also needs 2-3sec.</p>
  
  <p>So does anyone of you have an idea what i can do?
  I really need the different Activities in each Tab so, remove the Activities and use Views are not possible.</p>
  
  <p>Is it maybe possible to initialise the TabBar in a Thread/AsyncTask and invalidate the MainActivity after it finished?</p>
  
  <p>Thanks alot and greetz
  - Mirko</p>
  
  <p>EDIT: Here i added some code snippets, at first what is happened in my onCreate in the MainActivity:</p>
  
  <pre><code>    requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
      setContentView(R.layout.main_activity);
      getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.window_title);        
  
      Intent intent = new Intent(MainActivity.this, A.class);
      setupTab(R.string.tab_a, R.drawable..., intent);
      intent = new Intent(MainActivity.this, B.class);
      setupTab(R.string.tab_b,  R.drawable..., intent);
      intent = new Intent(MainActivity.this, C.class);
      setupTab(R.string.tab_c,  R.drawable..., intent);
      intent = new Intent(MainActivity.this, D.class);
      setupTab(R.string.tab_d, R.drawable..., intent);
      intent = new Intent(MainActivity.this, E.class);
      setupTab(R.string.tab_e,  R.drawable..., intent);
  
      mTabHost.setCurrentTab(0);
  </code></pre>
  
  <p>SetupTab:</p>
  
  <pre><code>private void setupTab(int labelRes, int iconRes, Intent intent) {
      String tag = (String) getText(labelRes);
      mSpec = mTabHost.newTabSpec(tag)
                    .setIndicator(createTabIndicator(this, tag, iconRes))
                    .setContent(intent);
      mTabHost.addTab(mSpec);
  }
  
  private View createTabIndicator(Context context, String title, int icon) {
      LinearLayout indicator = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.tab_indicator, null);
      TextView label = (TextView) indicator.findViewById(android.R.id.title);
      if(title == null) label.setVisibility(View.GONE);
      else label.setText(title);
      ImageView tabicon = (ImageView) indicator.findViewById(android.R.id.icon);
      tabicon.setImageResource(icon);
  
      return indicator;
  }
  </code></pre>
  
  <p>I also set a custom theme to my application.
  In traceview the method tabhost.addTab() needs more than 2000 msec. Maybe this is why i see the Blackscreen that long.</p>
  
  <p>Did someone know why there are the BlackScreen? I guess that there is no BlackScreen when i opan an normal different app. I know how to change the BlackScreen: setting the android:background in the theme to something different but it will not fix the time issue.</p>
  
  <p>I added a SplashScreen but i also see an black screen when the app starts up (but only some milliseconds). 
  The SplashScreen is an Activity with an ImageView and full_screen without title. It starts a thread that waits 2sec and than open the MainActivity and finishing themself.</p>