title: Could not activate JNI Handle exception with Floating action button in Xamarin.Android
body: <p>I'm trying to integrate FloatingActionButton in my application using the <a href="https://components.xamarin.com/view/fab" rel="nofollow noreferrer">xamarin component</a>. On layout inflation it throws the exception  "Could not activate JNI Handle 0xffb8b288 (key_handle 0x3ee746ea) of Java type  'com/refractored/fab/FloatingActionButton' as managed type 'com.refractored.fab.FloatingActionButton'."</p>
  
  <p><a href="https://i.stack.imgur.com/7Gxjv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7Gxjv.jpg" alt="enter image description here"></a></p>
  
  <p>layout file </p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
               xmlns:fab="http://schemas.android.com/apk/res-auto"
               android:layout_width="match_parent"
               android:layout_height="match_parent"&gt; 
      &lt;ListView
              android:id="@android:id/list"
              android:layout_width="match_parent"
              android:layout_height="match_parent" /&gt; 
      &lt;com.refractored.fab.FloatingActionButton
              android:id="@+id/fab"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="bottom|right"
              android:layout_margin="16dp"
              android:src="@drawable/ic_edit"
              fab:fab_colorNormal="@color/primary"
              fab:fab_colorPressed="@color/primary_pressed"
              fab:fab_colorRipple="@color/ripple" /&gt;
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>Activity code :</p>
  
  <pre><code>using System;
  using Android.App;
  using Android.Content;
  using Android.Runtime;
  using Android.Views;
  using Android.Widget;
  using Android.OS; 
  using Android.Support.V4.App; 
  using ActionBar =  Android.Support.V7.App.ActionBar;
  using Android.Text;
  using com.refractored.fab;  
  using Android.Support.V7.App; 
  
  namespace SampleActionBar
  {
      [Activity (Label = "SampleActionBar", MainLauncher = true, Icon = "@mipmap/icon")]
      public class MainActivity : ActionBarActivity, ActionBar.ITabListener
      { 
          protected override void OnCreate (Bundle savedInstanceState)
          {
              base.OnCreate (savedInstanceState);
              InitActionBar (); 
          } 
          private void InitActionBar()
          {
              if (SupportActionBar == null)
                  return;
  
              var actionBar = SupportActionBar;
              actionBar.NavigationMode = (int)ActionBarNavigationMode.Tabs;
  
              var tab1 = actionBar.NewTab();
              tab1.SetTabListener(this);
              tab1.SetText("ListView");
              actionBar.AddTab(tab1); 
          }
          public void OnTabReselected(ActionBar.Tab tab, Android.Support.V4.App.FragmentTransaction ft)
          {
          } 
          public void OnTabSelected(ActionBar.Tab tab, Android.Support.V4.App.FragmentTransaction ft)
          {
              switch (tab.Text)
              {
              case "ListView":
                  ft.Replace(Android.Resource.Id.Content, new ListViewFragment());
                  break; 
              }
          } 
          public void OnTabUnselected(ActionBar.Tab tab, Android.Support.V4.App.FragmentTransaction ft)
          { 
          } 
      } 
      public class ListViewFragment:Android.Support.V4.App.Fragment, IScrollDirectorListener, AbsListView.IOnScrollListener
      {
          public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
          {
              var root = inflater.Inflate(Resource.Layout.Main, container, false);
  
              var list = root.FindViewById&lt;ListView&gt;(Android.Resource.Id.List);
              var adapter = new ListViewAdapter(Activity, Resources.GetStringArray(Resource.Array.countries));
              list.Adapter = adapter;
  
              var fab = root.FindViewById&lt;FloatingActionButton&gt;(Resource.Id.fab);
              //fab.AttachToListView(list, this, this);
              fab.Click += (sender, args) =&gt;
              {
                  Toast.MakeText(Activity, "FAB Clicked!", ToastLength.Short).Show();
              };
              return root;
          }
          public void OnScrollDown()
          { 
          }
  
          public void OnScrollUp()
          { 
          }
  
          public void OnScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount)
          { 
          }
  
          public void OnScrollStateChanged(AbsListView view, ScrollState scrollState)
          { 
          }
      }
  }
  </code></pre>
  
  <p>Target sdk version is 23 and min version is 16.<br/>
  Upadted android support V4,V7 AppCompat(23.1.1.0) and refractored.fab(1.4.0) package.<br/>
  Sample code from xamarin component works fine without any issues<br/>
  What might be the cause for this exception? any suggestion/hints are appreciated.<br/>
  Thank you </p>