class SelfDestructiveThread {

    public <T> void postAndReply(final Callable<T> callable, final ReplyCallback<T> reply) {
        final Handler callingHandler = new Handler();
        post(new Runnable() {
            @Override
            public void run() {
                T t;
                try {
                    t = callable.call();
                } catch (Exception e) {
                    t = null;
                }
                final T result = t;
                callingHandler.post(new Runnable() {
                    @Override
                    public void run() {
                        reply.onReply(result);
                    }
                });
            }
        });
    }

    public  SelfDestructiveThread(
            String threadName, int priority, int destructAfterMillisec);

}