title: Easy way to call method in new thread
body: <p>I'm writing small app and now I discovered a problem.
  I need to call one(later maybe two) method (this method loads something and returns the result) without lagging in window of app.</p>
  
  <p>I found classes like <code>Executor</code> or <code>Callable</code>, but I don't understand how to work with those ones.</p>
  
  <p>Can you please post any solution, which helps me?</p>
  
  <p>Thanks for all advices.</p>
  
  <p><strong>Edit:</strong> The method <em>MUST</em> return the result. This result depends on parametrs.
  Something like this:</p>
  
  <pre><code>public static HtmlPage getPage(String page) throws FailingHttpStatusCodeException, MalformedURLException, IOException {
          return webClient.getPage(page);
  }
  </code></pre>
  
  <p>This method works about 8-10 seconds. After execute this method, thread can be stopped. But I need to call the methods every 2 minutes. </p>
  
  <p><strong>Edit:</strong> I edited code with this:</p>
  
  <pre><code>public static HtmlPage getPage(final String page) throws FailingHttpStatusCodeException, MalformedURLException, IOException {
      Thread thread = new Thread() {
          public void run() {
              try {
                  loadedPage = webClient.getPage(page);
              } catch (FailingHttpStatusCodeException | IOException e) {
                  e.printStackTrace();
              }
          }
      };
      thread.start();
      try {
          return loadedPage;
      } catch (Exception e) {
          return null;
      }
  
  }
  </code></pre>
  
  <p>With this code I get error again (even if I put <code>return null</code> out of <em>catch</em> block). </p>