title: App activity delay's at opening for first time on navigation drawer
body: <p>I'm facing a problem with an activity of my navigation drawer.When i open this activity 
  <strong>for the first time</strong>
   it has a delay 1-2 seconds and when i open it again it's getting better(not perfect but better).Is it because it's importing an other API maybe?I've added an asynctask but still nothing.</p>
  
  <p>Here is the code of this activity</p>
  
  <pre><code>public class ImportAPI extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener{
  public TextView fullnameside, emailside;
  
  public static String stravaToken;
  
  public static ImageButton btnStrava;
  public ImageView tickStrava;
  
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.importapi);
  
  
      Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
      setSupportActionBar(toolbar);
      getSupportActionBar().setDisplayShowTitleEnabled(false);
      toolbar.setTitle("");
      toolbar.setSubtitle("");
  
      DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
      ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
              this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
      drawer.addDrawerListener(toggle);
      toggle.syncState();
  
      NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
      View headerView = navigationView.getHeaderView(0);
      fullnameside = (TextView) headerView.findViewById(R.id.fullnameside);
      emailside = (TextView) headerView.findViewById(R.id.emailside);
      fullnameside.setText(""+GetInfo.fullname);
      emailside.setText(""+GetInfo.email);
  
      navigationView.setNavigationItemSelectedListener(this);
      navigationView.getMenu().getItem(3).setChecked(true);
  
      //STRAVA
      tickStrava=(ImageView) findViewById(R.id.tickStrava);
      btnStrava=(ImageButton) findViewById(R.id.stravaBtn);
      new connectStrava().execute("start");
  
  }
  
  @SuppressLint("StaticFieldLeak")
  class connectStrava extends AsyncTask&lt;String, String, String&gt; {
  
      @Override
      protected void onPreExecute() {
          super.onPreExecute();
          btnStrava.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  Intent getStravaApi= new Intent(ImportAPI.this,StravaSetupApi.class);
                  startActivity(getStravaApi);
              }
          });
  
          //GET ACCESS TOKEN FROM STRAVAS AUTHORIZE ACCOUNT
          String accessToken = StravaAuthenticateActivity.getStravaAccessToken(ImportAPI.this);
          stravaToken=accessToken; //make static var so i can use it anywhere i want
  
          //Get athletes activities from GetStravaAthleteActivities.java
          new GetStravaAthleteActivities.AthleteActivities();
  
          //check if token is null so i can display the tick and also disable the button press
          if(stravaToken!=null)
          {
              btnStrava.setEnabled(false);
              tickStrava.setVisibility(View.VISIBLE);
          }
          else {
              tickStrava.setVisibility(View.INVISIBLE);
          }
      }
  
      @Override
      protected String doInBackground(String... aurl) {
          Log.d("Alekos","TAK4");
          return null;
  
      }
      protected void onProgressUpdate(String... progress) {
  
          Log.d("ANDRO_ASYNC",progress[0]);
  
      }
  
      @Override
      protected void onPostExecute(String unused) {
      }
  
  }
  </code></pre>