    :millis  TimeUnit/MILLISECONDS
    :micros  TimeUnit/MICROSECONDS
    :nanos   TimeUnit/NANOSECONDS})
-
-(defn result-of
-  "Gets the result of an executed task.  The bare version will block until the
-  task is complete.  If provided a time with no unit, the unit is assumed to be
-  milliseconds.  The unit may be a an instance of java.util.concurrent.TimeUnit
-  or one of the following keywords: :seconds, :millis, :micros, or :nanos.
-
-  Note that if you use a TimeUnit instance, units larger than seconds are not
-  supported before API level 9."
-  ([task]
-   (result-of task ::ignored ::ignored))
-  ([task time]
-   (result-of task time TimeUnit/MILLISECONDS))
-  ([^Task task time units]
-   {:pre [; must be executed
-          (.real_task task)
-          ; time must be ::ignored or a non-negative number
-          (or (= ::ignored time)
-              (and (number? time)
-                   (not (neg? time))))
-          ; units must be a valid keyword or a TimeUnit
-          (or (= ::ignored units)
-              (and (keyword? units)
-                   (units unit-map))
-              (instance? TimeUnit units))]}
-   (let [^AsyncTask real-task (.real_task task)]
-     (if (= ::ignored time)
-       (.get real-task)
-       (.get real-task time (cond
-                              (keyword? units) (units unit-map)
-                              :else units))))))
-
-(defn cancel
-  ([^Task task may-interrupt?]
-   {:pre [; must be executed
-          (.real_task task)]}
-   (let [^AsyncTask real-task (.real_task task)]
-     (.cancel real-task (boolean may-interrupt?))))
-  ([task]
-   (cancel task true))
-  )
-

  "Causes the function to be added to the message queue.  The function will
  execute on the UI thread.  Returns true if successfully placed in the message
  queue."
  [^View view ^IFn f]
  (.post view (reify Runnable (run [this] (f)))))

(defmacro post
  "Causes the macro body to be added to the message queue.  It will execute on
  the UI thread.  Returns true if successfully placed in the message queue."
  [^View view & body]
  `(post* ~view (fn [] ~@body)))

(defn post-delayed*

  specified amount of time elapses.  The function will execute on the UI
  thread.  Returns true if successfully placed in the message
  queue."
  [^View view, millis f]
  (.postDelayed view f millis))

(defmacro post-delayed
  "Causes the macro body to be added to the message queue.  It will execute on
  the UI thread.  Returns true if successfully placed in the message queue."
  [view millis & body]
  `(post-delayed* ~view ~millis (fn [] ~@body)))

(def ^{:doc "A map of unit keywords to TimeUnit instances."
       :private true}
