# which is a subclass of `Activity` and `Context` (in Java). It represent
# main activity of the running application. Use it to get anything related
# to the `Context` and as anchor to execute Java UI code.
-module native_app_glue
+module native_app_glue is ldflags "-landroid"
import platform
import log
# We use the `userData` field of the C structure to store an handle to
# the associated App
private fun user_data: App `{ return recv->userData; `}
- private fun user_data=(val: App) `{ recv->userData = val; `}
+ private fun user_data=(val: App) `{
+ App_incr_ref(val);
+ recv->userData = val;
+ `}
# Fill this in with the function to process input events. At this point
# the event has already been pre-dispatched, and it will be finished upon