title: How to implement a background thread using java.util.concurrent package?
body: <p>This is the code I used first but in latest Android version <code>AsyncTask</code> class is deprecated and
  therefore it was not responding and then I used the <code>Thread</code> class but that class is also not working.
  I want the same result as I was getting with the <code>AsyncTask</code> class.
  I know that I have to use some executor class of java.util.concurrent package but don't know which and how to use it.
  Please help me with this thing.</p>
  <pre><code>private static final String USGS_REQUEST_URL =
              &quot;https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&amp;starttime=2016-01-01&amp;endtime=2016-05-02&amp;minfelt=50&amp;minmagnitude=5&quot;;
  
  EarthquakeAsyncTask task = new EarthquakeAsyncTask();
          task.execute(USGS_REQUEST_URL);
  private class EarthquakeAsyncTask extends AsyncTask&lt;String, Void, Event&gt; {
  
          @Override
          protected Event doInBackground(String... urls) {
  
              // Perform the HTTP request for earthquake data and process the response.
              Event result = Utils.fetchEarthquakeData(urls[0]);
              return result;
          }
  
          @Override
          protected void onPostExecute(Event result) {
              // Update the information displayed to the user.
              updateUi(result);
          }
      }
  </code></pre>
  <pre><code>private static final String USGS_REQUEST_URL =
              &quot;https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&amp;starttime=2016-01-01&amp;endtime=2016-05-02&amp;minfelt=50&amp;minmagnitude=5&quot;;
  
  earthquakeRunnable runnable = new earthquakeRunnable(USGS_REQUEST_URL);
          runnable.start();
  
  private class earthquakeRunnable extends Thread{
  
              String urls;
              earthquakeRunnable(String url){
                  this.urls = url;
              }
              @Override
              public void run() {
                  // Perform the HTTP request for earthquake data and process the response.
                  Event result = Utils.fetchEarthquakeData(urls);
                  // Update the information displayed to the user
                  updateUi(result);
              }
          }
  </code></pre>