title: Getting blank screen when switching between Activities ( Activity with services)?
body: <p>In my app i am using Services for some requirements, When i am switching from Activity1 to Activity2 i am getting blank screen for few seconds. In Activity2 having some services, This is the code i am using  </p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      if(isOnline()){
  
      }else{ 
          alert();
      }
      dialog = new ProgressDialog(this);   
      dialog.setCancelable(false);
      app_preferences = new AppPreferences(this);
      new LongOperation().execute();
  
      setContentView(R.layout.activity_accounts); 
  }
  </code></pre>
  
  <p>Using asynctask to start services from onCreate(). <code>new LongOperation().execute();</code></p>
  
  <pre><code>private class LongOperation extends AsyncTask&lt;String, Void, String&gt; {
      @Override
      protected void onPreExecute() {          
          ProgressBar_show();
      }
      @Override
      protected String doInBackground(String... params) { 
          LoggingAccounts();
          return null;
      }
      @Override
      protected void onPostExecute(String result) {        
          ProgressBar_hide();
      } 
  }
  
  private void LoggingAccounts() {
  
      Account_Added_Log_States();
  
      ArrayList&lt;AccountInfo&gt; _Accounts_list = new ArrayList&lt;AccountInfo&gt;();
      accounts_data = new AccountDataSource(this);
      accounts_data.open();       
      _Accounts_list = accounts_data.getAllAccounts();
      accounts_data.close();       
      Log.i(TAG, "No of acc's-" + _Accounts_list.size()); 
  
      for(AccountInfo acc : _Accounts_list) {
          Log.i(TAG, "Acc type " +acc.getAcc_Type());
  
          if(acc.getAcc_Type().equals(UsedStrings.GoogleAccount) &amp;&amp; Gtalk_Log_State ) {
              /////// service start
              final Intent gtalk_intent = new Intent(AccountsActivity.this, GtalkService.class);
              gtalk_intent.putExtra("Key", "gtalk service*****");
              gtalk_intent.putExtra("user_name", acc.getAcc_Name());
              gtalk_intent.putExtra("user_pass", acc.getAcc_Pass());
              Thread t = new Thread(){
                  public void run(){
                      startService(gtalk_intent);
                  }
              };
              t.start(); 
          }
      }
  }
  </code></pre>
  
  <p>Like this i am using 3 different services in this activity. when i am switching from activity getting blank screen.</p>