title: What is the best way to do background tasks?
body: <p>I am studying Android (Java) and until then performed my background tasks using <code>AsyncTask</code>.</p>
  
  <pre><code>public class SuaClasse extends AsyncTask&lt;String,Integer,Integer&gt;{
    @Override
    protected void onPreExecute(){
      //Codigo
    }
    @Override
    protected Integer doInBackground(String... params) {
      //Codigo
    }
    @Override
    protected void onPostExecute(Integer numero){
      //Codigo
    }
    protected void onProgressUpdate(Integer… params){
      //Codigo
    }
  
  }
  </code></pre>
  
  <p>I recently read that this may not be the best way, and that <code>AsyncTask</code> tends to become obsolete soon ... something about <code>RxJava</code> has been quoted.</p>
  
  <p>Is that true?</p>
  
  <p>I would like to know what are the ways to do background tasks, what are the the details of each and, if any, what is the best way.</p>