title: How to pass a JNI C# class into Java or handle this situation?
body: <p>I'm trying to call a Java method from C#, it's called like this from java:</p>
  
  <pre><code>EgamePay.pay(thisActivity, payAlias, new EgamePayListener() {
              @Override
              public void paySuccess(String alias) {
              }
  
              @Override
              public void payFailed(String alias, int errorInt) {
              }
  
              @Override
              public void payCancel(String alias) {
              }
          });
  </code></pre>
  
  <p>The first two parameters are ok, but how do I pass the EgamePayListner through in C#? Simply creating a C# class with the same functions won't work...</p>
  
  <p>Here's what I'm doing currently:</p>
  
  <pre><code>using (AndroidJavaClass jc = new AndroidJavaClass("cn.egame.terminal.smspay.EgamePay"))
          {
              System.IntPtr cls_Activity = AndroidJNI.FindClass("com/unity3d/player/UnityPlayer");
              System.IntPtr fid_Activity = AndroidJNI.GetStaticFieldID(cls_Activity, "currentActivity", "Landroid/app/Activity;");
              object[] p = { fid_Activity, "payAlias", new EgamePayListener() };
              jc.CallStatic("pay", p);
          }
  
  ..
  
   class EgamePayListener
      {
          public void paySucess(string alias)
          {
          }
  
          public void payFailed(string alians, int errorInt)
          {
          }
  
          public void payCancel(string alias)
          {
          }
      }
  </code></pre>
  
  <p>Obviously that's wrong, how can I handle this situation so that I can get notified back in C# land when those functions are fired?</p>