Function with_activity

Source
pub fn with_activity<F, R>(f: F) -> Result<R>
where F: for<'a, 'b, 'c, 'd> FnOnce(&'a mut JNIEnv<'b>, &'c JObject<'d>) -> R,
Expand description

Invokes the given closure f with the current JNI environment and the current activity.

Returns None upon error, including:

  • If the function that gets the current activity and JNI environment has not been set.
  • If the current JNI environment cannot be obtained.