nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge: Added `copy_from` service to `NativeString`
[nit.git]
/
lib
/
android
/
http_request.nit
diff --git
a/lib/android/http_request.nit
b/lib/android/http_request.nit
index
d7427c3
..
d4e9b0f
100644
(file)
--- a/
lib/android/http_request.nit
+++ b/
lib/android/http_request.nit
@@
-30,7
+30,15
@@
in "Java" `{
`}
redef class App
`}
redef class App
- redef fun run_on_ui_thread(task) do app.native_activity.run_on_ui_thread task
+ redef fun run_on_ui_thread(task)
+ do
+ if app.activities.not_empty then
+ app.native_activity.run_on_ui_thread task
+ else
+ # There is no UI, it must be a service, run on the caller thread
+ task.main
+ end
+ end
end
redef class Text
end
redef class Text
@@
-102,3
+110,8
@@
private extern class JavaHttpResponse in "Java" `{ org.apache.http.HttpResponse
}
`}
end
}
`}
end
+
+# Force linearization of print
+#
+# TODO prioritize `android::log`
+redef fun print(object) do super