title: display loadingscreen while async task
body: <p>I have this async task that call an web service and parse an xml</p>
  
  <pre><code>@Override
  protected void onPreExecute(){
  super.onPreExecute();
  time = System.currentTimeMillis();
  }
   protected Boolean doInBackground(Integer... params) {
    //code 
   }
  
  protected void onPostExecute(Boolean result) {
  super.onPostExecute(result);
      difftime = System.currentTimeMillis() - time;
   }
  </code></pre>
  
  <p>while async task is executing I want to display an loading screen,but the loading screen finishes before async task finish if I am doing like this </p>
  
  <pre><code>        super.onCreate(savedInstanceState);
          setContentView(R.layout.loading_screen);
  
              final CallWebService callTarif = new CallWebService(6,sett.getDeviceId());
              callTarif.execute();
  
  new Handler().postDelayed(new Runnable(){ 
          @Override 
              public void run() { 
  
                  LoadingScreen.this.finish(); 
                  Intent intent = new Intent(LoadingScreen.this, NextActivity.class);
                                      startActivity(intent);            
              } 
  
          }
          },callTarif.difftime);
  </code></pre>