returning ints from a handler
<p>I have a very, very messed up method. I want to return <code>ints</code> from a handler. My code is like this:</p>

<pre><code>public void getCasesFromFolder() {

    msg = handler.obtainMessage();


    timer.schedule(new TimerTask(){
          public void run(){
              if(folder.list().length == 0)  {
                  msg.obj = "0";
                  handler.sendMessage(msg);
              }

              else {
                    msg.obj = Integer.toString(folder.list().length) ;
                    handler.sendMessage(msg);
              }

          }
    }, delay, 3000);
}

private Handler handler = new Handler() {

    @SuppressWarnings("unchecked")
    @Override
    public void handleMessage(Message m) {

        String message = (String) m.obj;
        if(message.equals("0")) {
            returnValues(0); 
        }
        else {
            returnValues(Integer.parseInt(message));
        }

    }

    public int returnValues(int i) {

        if(i == 0)
            return 0;
        else
            return i; 

    }
};
</code></pre>

<p>This doesn't work, of course. How can I return a int from a handler? </p>
