title: FindClass and GetMethodID failes on android jni
body: <p>I have c++ lib used with my application. I passed java object to jni and saved it to global reference. Then, I wish to call method of this java object from jni from antoher thread (I use pthread).</p>
  
  <p>Java class is:</p>
  
  <pre><code>public class WaitingServiceReadyCallback {
     public void ready(String serviceName) throws Exception { ... // some code }
  }
  </code></pre>
  
  <p>To call java method I use next code:</p>
  
  <pre><code>jvm-&gt;AttachCurrentThread(&amp;env, 0);
  cls = env-&gt;GetObjectClass(__obj__); // __obj__ is global reference to object.
  if (!cls)
     goto detach;
  mid = env-&gt;GetMethodID(cls, "ready", "(Ljava/lang/String;)V");
  </code></pre>
  
  <p>There <code>GetMethodID</code> fails to find method.
  When I use </p>
  
  <pre><code>cls = env-&gt;FindClass("com/mypackage/WaitingServiceReadyCallback");
  </code></pre>
  
  <p>instead of <code>GetObjectClass</code>, <code>FindClass</code> fails to find this class.</p>
  
  <p>I tried to check class name of the object referencd by my <code>__obj__</code> global reference (used <code>getName</code> from <code>com/java/Class</code>, made call to <code>getName</code> in the same place of my code as above call to <code>ready</code>), I got right class name - <code>com.mypackage.WaitingServiceReadyCallback</code>.</p>
  
  <p>I am sure that class exists and loaded (java code executed before jni and instance of this class is created there), I am sure that method exists in the class.</p>
  
  <p>So, I can't understand, what I done wrong? </p>