I created java binding library via visual studio extension called Xamarin.GradleBinding. I added ru.rambler.android:swipe-layout:1.0.14
package and while using its SwipeLayout
, it all works well. But unfortunately it did not created corresponding C# classes or anything like that. I tried adding package manually but still nothing.
I checked the source on GitHub. SwipeLayout
has a public void
method reset()
without parameters:
public void reset()
I try to call this method from c# with 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 are successfully found but calling
JNIEnv.CallObjectMethod(_swiper.Handle, method);
This method crashes the app, it does not even goes into catch block.
Tt must be cause of the _swiper.Handle
first parameter.
_swiper
field is of type ViewGroup
since SwipeLayout
is derived from ViewGroup
.
I can't find how to get the pointer of the view to pass that method.
while debugging, when I investigate the _swiper
, it seems to be the correct instance of SwipeLayout