Xamarin.Android binding Call java Object Method

I created the Java binding library through a visual studio extension called Xamarin.GradleBinding. I added the package ru.rambler.android:swipe-layout:1.0.14and using it SwipeLayouteverything works fine. But, unfortunately, he did not create the corresponding C # classes or anything like that. I tried to add the package manually, but still nothing.

I checked the source on GitHub . SwipeLayouthas a public voidmethod reset()without parameters:

public void reset()

I am trying to call this method from C # using JNIEnv.

IntPtr type = JNIEnv.FindClass("ru/rambler/libs/swipe_layout/SwipeLayout");
IntPtr method = JNIEnv.GetMethodID(type, "reset", "()V");
try
{
    JNIEnv.CallObjectMethod(_swiper.Handle, method);
}
catch (Exception ex)
{
    var s = ex.Message;
}

Type and method found successfully, but call

JNIEnv.CallObjectMethod(_swiper.Handle, method);

This method disables the application; it does not even fall into the catch block.

Tt _swiper.Handle. _swiper ViewGroup, SwipeLayout ViewGroup. , .

, _swiper, SwipeLayout

enter image description here

+6
1

# Xamarin.Android. , GitHub, , .

, , , , .java.

+1

All Articles