Skip to content

Commit 77557fb

Browse files
committed
Add overlooked JNI method to RegisterNatives.
1 parent 1ee099f commit 77557fb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hello-jniCallback/app/src/main/cpp/hello-jnicallback.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ TickContext g_ctx;
4949
*
5050
* hello-jniCallback/app/src/main/java/com/example/hellojnicallback/MainActivity.java
5151
*/
52-
extern "C" JNIEXPORT jstring JNICALL
53-
Java_com_example_hellojnicallback_MainActivity_stringFromJNI(JNIEnv* env,
54-
jobject) {
52+
jstring StringFromJni(JNIEnv* env, jobject) {
5553
#if defined(__arm__)
5654
#if defined(__ARM_ARCH_7A__)
5755
#if defined(__ARM_NEON__)
@@ -288,6 +286,8 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
288286
if (c == nullptr) return JNI_ERR;
289287

290288
static const JNINativeMethod methods[] = {
289+
{"stringFromJNI", "()Ljava/lang/String;",
290+
reinterpret_cast<void*>(StringFromJni)},
291291
{"startTicks", "()V", reinterpret_cast<void*>(StartTicks)},
292292
{"StopTicks", "()V", reinterpret_cast<void*>(StopTicks)},
293293
};

0 commit comments

Comments
 (0)