title: Android NDK method not found...calling Java from C++
body: <p>I want to call a Java method from C++. I've followed other examples I've found, but I keep getting the error:</p>
  
  <pre><code>GetMethodID: method not found: Lcom/test/ndk/GL2JNIActivity;.GetFiles:(L/java/lang/String;Ljava/lang/String;Z;)V
  </code></pre>
  
  <p>What am I doing wrong here? I suspect my method signature string is wrong for env->GetMethodID(), but it looks like it's correct from other examples I've seen.</p>
  
  <p>C++:</p>
  
  <pre><code>namespace Resource
  {
  FileInfo *GetFiles(const char *path, const char *mask, bool directory)
  {
      JNIEnv *env = Android_JNI_GetEnv();
      jstring jstr1 = env-&gt;NewStringUTF(path);
      jstring jstr2 = env-&gt;NewStringUTF(mask);
  
      fileInfos = NULL;
  
      jclass clazz = env-&gt;FindClass("com/test/ndk/GL2JNIActivity");
      jmethodID mid = env-&gt;GetMethodID(clazz, "GetFiles", "(Ljava/lang/String;Ljava/lang/String;Z;)V");
      jobject obj = env-&gt;CallStaticObjectMethod(clazz, mid);
  
      return fileInfos;
  }
  }
  </code></pre>
  
  <p>Java:</p>
  
  <pre><code>package com.test.ndk;
  
  import java.io.File;
  
  public class GL2JNIActivity extends Activity implements SensorEventListener {
  
  public static void GetFiles(String sentPath, String mask, boolean directory)
  {
      String path = Environment.getExternalStorageDirectory().toString()+sentPath;
      Log.d("Files", "Path: " + path);
      File f = new File(path);
      File file[] = f.listFiles();
      Log.d("Files", "Size: "+ file.length);
      for (int i=0; i &lt; file.length; i++)
      {
          Log.d("Files", "FileName:" + file[i].getName());
          GL2JNILib.AddFileToList(file[i].getName(), file[i].isDirectory());
      }
  }
  }
  </code></pre>