title: Simple AsyncTasc - better solution - prevent memory leak
body: <p>I'm trying to code a AsyncTask, but AndroidStudio give me warn:   </p>
  
  <pre><code>this Aynctask class should be static or leaks might occur
  </code></pre>
  
  <p>I found in stack 3 solution here: <a href="https://stackoverflow.com/questions/44309241/warning-this-asynctask-class-should-be-static-or-leaks-might-occur?utm_medium=organic&amp;utm_source=google_rich_qa&amp;utm_campaign=google_rich_qa">click</a> :</p>
  
  <ol>
  <li><p>asyncTasc static </p></li>
  <li><p>weakReference   </p></li>
  <li><p>asyncListener  </p></li>
  </ol>
  
  <p>This topic is old, so for sure I ask:  these solution are still 'on time' ?<br>
  Which of these solutions is professional and used in real projects?</p>
  
  <p>My code:</p>
  
  <pre><code>@Override
  public void onClick(View view) {
  
      String loginFromUser = etLogin.getText().toString();
      String passwordFromUser = etPassword.getText().toString();
      GetUsers getUsers = new GetUsers();
      getUsers.execute(loginFromUser, passwordFromUser);
  
  }
  </code></pre>
  
  <p>.</p>
  
  <pre><code>private class GetUsers extends AsyncTask&lt;String, Void, Void&gt;{
  
      @Override
      protected Void doInBackground(String... strings) {
  
          String login = strings[0];
          String password = strings[1];
  
          Log.w("Credentials: ", "" + login + password);
  
          return null;
      }
  }
  </code></pre>